/* Variables and Reset */
:root {
    --bg-color: #0b0f19;
    --card-bg: rgba(20, 27, 45, 0.75);
    --card-border: rgba(255, 255, 255, 0.08);
    --text-main: #f3f4f6;
    --text-muted: #9ca3af;
    --primary: #f97316;
    --primary-hover: #ea580c;
    --primary-glow: rgba(249, 115, 22, 0.25);
    --secondary: #374151;
    --secondary-hover: #4b5563;
    --success: #10b981;
    --success-hover: #059669;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --warning: #f59e0b;
    --border-radius-lg: 16px;
    --border-radius-md: 10px;
    --font-sans: 'Inter', sans-serif;
    --font-display: 'Montserrat', sans-serif;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    font-family: var(--font-sans);
    line-height: 1.6;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Glowing Backgrounds */
.bg-glow-1 {
    position: fixed;
    top: -10%;
    right: -10%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(249, 115, 22, 0.12) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

.bg-glow-2 {
    position: fixed;
    bottom: -10%;
    left: -10%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(16, 185, 129, 0.08) 0%, rgba(0,0,0,0) 70%);
    z-index: -1;
    pointer-events: none;
}

/* Header & Navbar */
.navbar {
    background: rgba(11, 15, 25, 0.8);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--card-border);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.25rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-group {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: rgba(255, 255, 255, 0.96);
    padding: 0.5rem 1.25rem;
    border-radius: var(--border-radius-md);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.logo-pisirgen-wrapper, .logo-borusan-cat-wrapper {
    display: flex;
    align-items: center;
    height: 38px;
}

.logo-svg-pisirgen {
    height: 100%;
    width: auto;
}

.logo-svg-borusan-cat {
    height: 100%;
    width: auto;
    border-left: 1.5px solid rgba(0, 0, 0, 0.15);
    padding-left: 1.5rem;
}

@media (max-width: 640px) {
    .logo-group {
        gap: 0.75rem;
        padding: 0.4rem 0.75rem;
    }
    .logo-pisirgen-wrapper, .logo-borusan-cat-wrapper {
        height: 28px;
    }
    .logo-svg-borusan-cat {
        padding-left: 0.75rem;
    }
}

/* Main Layout */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 1200px;
    margin: 2rem auto;
    padding: 0 1.5rem;
}

/* Cards & Sections */
.content-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: var(--border-radius-lg);
    padding: 2.5rem;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    margin-bottom: 2rem;
    display: none;
    animation: fadeInUp 0.5s ease;
}

.content-card.active {
    display: block;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card-header {
    text-align: center;
    margin-bottom: 2.5rem;
}

.card-header h2 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 2rem;
    margin-bottom: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.subtitle {
    color: var(--text-muted);
    font-size: 1rem;
}

/* Progress Tracker */
.progress-container {
    position: relative;
    max-width: 600px;
    margin: 0 auto 3rem auto;
    padding: 0 1rem;
}

.progress-bar {
    position: absolute;
    top: 50%;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary), var(--success));
    transform: translateY(-50%);
    z-index: 1;
    transition: var(--transition);
    border-radius: 2px;
    box-shadow: 0 0 8px var(--primary-glow);
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    position: relative;
    z-index: 2;
}

.step-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #1f2937;
    border: 2px solid var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--text-muted);
    transition: var(--transition);
    user-select: none;
}

.step-dot.active {
    background: var(--bg-color);
    border-color: var(--primary);
    color: var(--primary);
    box-shadow: 0 0 12px var(--primary-glow);
}

.step-dot.completed {
    background: var(--success);
    border-color: var(--success);
    color: #fff;
    box-shadow: 0 0 12px rgba(16, 185, 129, 0.3);
}

.hidden-step-dot {
    display: none !important;
}

/* Wizard Form Step Animations & Setup */
.wizard-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.wizard-step.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.step-title {
    font-family: var(--font-display);
    font-size: 1.4rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
}

/* Options Grid Layout */
.option-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
    max-width: 700px;
    margin: 0 auto;
}

.option-grid.grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    max-width: 800px;
}

.option-card {
    cursor: pointer;
    position: relative;
}

.option-card input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.option-content {
    background: rgba(31, 41, 55, 0.45);
    border: 2px solid var(--secondary);
    border-radius: var(--border-radius-md);
    padding: 2rem 1.5rem;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    height: 100%;
    transition: var(--transition);
}

.option-card:hover .option-content {
    border-color: rgba(249, 115, 22, 0.5);
    background: rgba(31, 41, 55, 0.75);
    transform: translateY(-3px);
}

.option-card input[type="radio"]:checked + .option-content {
    border-color: var(--primary);
    background: rgba(249, 115, 22, 0.08);
    box-shadow: 0 0 15px var(--primary-glow);
}

.option-icon {
    font-size: 2.5rem;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
    transition: var(--transition);
}

.option-card input[type="radio"]:checked + .option-content .option-icon {
    color: var(--primary);
    transform: scale(1.1);
}

.currency-symbol {
    font-size: 3rem;
    font-weight: 700;
    line-height: 1;
    font-family: var(--font-display);
    color: var(--text-muted);
    transition: var(--transition);
}

.option-card input[type="radio"]:checked + .option-content .currency-symbol {
    color: var(--primary);
}

.option-label {
    font-weight: 700;
    font-size: 1.15rem;
    font-family: var(--font-display);
}

.option-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* Inputs styling */
.input-group-wrapper {
    max-width: 480px;
    margin: 0 auto;
}

.input-with-badge {
    position: relative;
    display: flex;
    align-items: stretch;
    background: rgba(31, 41, 55, 0.45);
    border: 2px solid var(--secondary);
    border-radius: var(--border-radius-md);
    overflow: hidden;
    transition: var(--transition);
}

.input-with-badge:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 15px var(--primary-glow);
}

.input-with-badge input {
    flex: 1;
    background: transparent;
    border: none;
    padding: 1.25rem 1.5rem;
    color: var(--text-main);
    font-size: 1.25rem;
    font-weight: 600;
    outline: none;
    width: 100%;
}

.currency-badge {
    background: var(--secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 1.5rem;
    font-weight: 700;
    font-size: 1.35rem;
    color: var(--text-main);
    border-left: 2px solid var(--secondary);
    transition: var(--transition);
}

.input-with-badge:focus-within .currency-badge {
    background: var(--primary);
    border-left-color: var(--primary);
}

.input-helper-text {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    text-align: center;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.85rem 2rem;
    font-size: 1rem;
    font-weight: 600;
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: var(--transition);
    outline: none;
    border: none;
    font-family: var(--font-sans);
}

.btn-primary {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 14px var(--primary-glow);
}

.btn-primary:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
}

.btn-secondary {
    background: var(--secondary);
    color: var(--text-main);
}

.btn-secondary:hover {
    background: var(--secondary-hover);
}

.btn-outline {
    background: transparent;
    border: 1.5px solid var(--secondary);
    color: var(--text-main);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(249, 115, 22, 0.05);
}

.btn-outline-primary {
    background: transparent;
    border: 1.5px solid var(--primary);
    color: var(--primary);
}

.btn-outline-primary:hover {
    background: var(--primary);
    color: white;
}

.btn-outline-danger {
    background: transparent;
    border: 1.5px solid var(--danger);
    color: var(--danger);
}

.btn-outline-danger:hover {
    background: var(--danger);
    color: white;
}

.btn-block {
    width: 100%;
}

.btn.disabled, .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
    box-shadow: none !important;
}

/* Wizard actions footer */
.wizard-actions {
    display: flex;
    justify-content: space-between;
    max-width: 700px;
    margin: 3rem auto 0 auto;
    padding-top: 1.5rem;
    border-top: 1px solid var(--card-border);
}

/* Results Section Layout */
.results-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2.5rem;
    align-items: start;
}

@media (max-width: 868px) {
    .results-layout {
        grid-template-columns: 1fr;
    }
}

.summary-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.summary-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
}

.summary-item {
    background: rgba(31, 41, 55, 0.3);
    border: 1px solid var(--card-border);
    padding: 1.25rem;
    border-radius: var(--border-radius-md);
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.summary-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.summary-value {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-main);
}

.summary-value.highlight {
    color: var(--primary);
}

.summary-value.highlight-success {
    color: var(--success);
}

.summary-value.badge-primary {
    color: var(--primary);
    font-size: 1.35rem;
}

.summary-total-box {
    background: linear-gradient(135deg, rgba(249, 115, 22, 0.1), rgba(16, 185, 129, 0.05));
    border: 1.5px dashed var(--primary);
    border-radius: var(--border-radius-md);
    padding: 1.75rem;
    text-align: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.total-label {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.total-value {
    font-size: 2.25rem;
    font-weight: 800;
    color: var(--success);
    font-family: var(--font-display);
}

/* Data Tables */
.payment-schedule {
    background: rgba(31, 41, 55, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.75rem;
}

.payment-schedule h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    margin-bottom: 1.25rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.table-responsive {
    max-height: 400px;
    overflow-y: auto;
    border-radius: 6px;
    border: 1px solid var(--card-border);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.9rem;
}

.data-table th {
    background: #1f2937;
    padding: 0.85rem 1rem;
    font-weight: 600;
    color: var(--text-main);
    position: sticky;
    top: 0;
    z-index: 10;
    border-bottom: 2px solid var(--card-border);
}

.data-table td {
    padding: 0.85rem 1rem;
    border-bottom: 1px solid var(--card-border);
    color: var(--text-muted);
}

.data-table tbody tr:hover td {
    background: rgba(255, 255, 255, 0.03);
    color: var(--text-main);
}

.action-row {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
}

/* Auth / Admin Login styles */
.admin-auth-box {
    max-width: 420px;
    margin: 2rem auto;
    padding: 2rem;
    background: rgba(31, 41, 55, 0.35);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.auth-header {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-icon {
    font-size: 3rem;
    color: var(--primary);
    margin-bottom: 1rem;
    filter: drop-shadow(0 0 10px var(--primary-glow));
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 0.5rem;
}

.input-with-icon {
    position: relative;
}

.input-with-icon i {
    position: absolute;
    left: 1.25rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
}

.input-with-icon input, .form-group input, .form-group select {
    width: 100%;
    background: rgba(17, 24, 39, 0.8);
    border: 1.5px solid var(--secondary);
    border-radius: var(--border-radius-md);
    padding: 0.85rem 1.25rem;
    padding-left: 3rem;
    color: var(--text-main);
    font-family: var(--font-sans);
    outline: none;
    transition: var(--transition);
}

.form-group input:not(.input-with-icon input) {
    padding-left: 1.25rem;
}

.form-group select {
    padding-left: 1.25rem;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%239ca3af' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
}

.input-with-icon input:focus, .form-group input:focus, .form-group select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

/* Alerts */
.error-alert, .success-alert {
    padding: 0.75rem 1.25rem;
    border-radius: var(--border-radius-md);
    font-size: 0.85rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
}

.error-alert {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid var(--danger);
    color: #fca5a5;
}

.success-alert {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid var(--success);
    color: #a7f3d0;
}

.hidden {
    display: none !important;
}

/* Admin Dashboard layout */
.admin-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--card-border);
}

@media (max-width: 640px) {
    .admin-header-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
}

.admin-layout-matrix {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.grace-selector-box {
    background: rgba(31, 41, 55, 0.3);
    border: 1.5px dashed var(--primary);
    border-radius: var(--border-radius-md);
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    flex-wrap: wrap;
}

.grace-selector-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.inline-select {
    background: var(--bg-color);
    border: 1.5px solid var(--secondary);
    color: var(--text-main);
    padding: 0.5rem 2.5rem 0.5rem 1rem;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23f97316' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.1em;
    transition: var(--transition);
}

.inline-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 10px var(--primary-glow);
}

.helper-text-inline {
    font-size: 0.85rem;
    color: var(--text-muted);
    flex: 1;
    min-width: 250px;
}

.matrices-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

@media (max-width: 992px) {
    .matrices-container {
        grid-template-columns: 1fr;
    }
}

.matrix-card {
    background: rgba(31, 41, 55, 0.2);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.matrix-header h3 {
    font-family: var(--font-display);
    font-size: 1.15rem;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.matrix-table input[type="number"] {
    width: 100%;
    background: rgba(17, 24, 39, 0.6);
    border: 1px solid var(--secondary);
    border-radius: 6px;
    padding: 0.4rem 0.6rem;
    color: var(--text-main);
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: var(--transition);
}

.matrix-table input[type="number"]:focus {
    border-color: var(--primary);
    background: rgba(17, 24, 39, 0.9);
    box-shadow: 0 0 8px var(--primary-glow);
}

.add-vade-row {
    display: flex;
    gap: 0.75rem;
    align-items: center;
    margin-top: 0.5rem;
    background: rgba(17, 24, 39, 0.3);
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid var(--card-border);
}

.add-vade-row input {
    background: var(--bg-color);
    border: 1.5px solid var(--secondary);
    color: var(--text-main);
    padding: 0.4rem 0.75rem;
    border-radius: 6px;
    width: 120px;
    outline: none;
    font-weight: 600;
    transition: var(--transition);
}

.add-vade-row input:focus {
    border-color: var(--primary);
}

.admin-bottom-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 1rem;
}

@media (max-width: 768px) {
    .admin-bottom-grid {
        grid-template-columns: 1fr;
    }
}

.admin-sidebar-card {
    background: rgba(31, 41, 55, 0.25);
    border: 1px solid var(--card-border);
    border-radius: var(--border-radius-md);
    padding: 1.75rem;
}

.admin-sidebar-card.system-card {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.admin-sidebar-card h3 {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: 1.15rem;
    margin-bottom: 1.25rem;
    padding-bottom: 0.5rem;
    border-bottom: 1.5px solid rgba(249, 115, 22, 0.2);
}

.divider {
    height: 1px;
    background: var(--card-border);
    margin: 2rem 0;
}

/* Badges & Tables in Admin */
.badge {
    display: inline-block;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    font-weight: 600;
    border-radius: 9999px;
    text-transform: uppercase;
}

.badge-status-sifir {
    background: rgba(16, 185, 129, 0.15);
    color: #a7f3d0;
    border: 1px solid var(--success);
}

.badge-status-ikinciel {
    background: rgba(245, 158, 11, 0.15);
    color: #fde68a;
    border: 1px solid var(--warning);
}

.badge-currency {
    background: rgba(59, 130, 246, 0.15);
    color: #bfdbfe;
    border: 1px solid #3b82f6;
}

.btn-delete-rule {
    color: var(--danger);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0.25rem;
    transition: var(--transition);
}

.btn-delete-rule:hover {
    color: #f87171;
    transform: scale(1.1);
}

.btn-sm {
    padding: 0.4rem 1rem;
    font-size: 0.8rem;
}

.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }

/* Footer */
.footer {
    border-top: 1px solid var(--card-border);
    padding: 1.5rem 0;
    background: rgba(11, 15, 25, 0.9);
    margin-top: auto;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    text-align: center;
    color: var(--text-muted);
    font-size: 0.85rem;
}
