/*
 * CTD Liquidity Portal - World Class Institutional Design
 * Navy (#002147) + White design system
 */

:root {
    --navy: #00234b;
    /* Deepened institutional navy */
    --hover-navy: #003a7a;
    --accent: #2563eb;
    --white: #ffffff;
    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-400: #94a3b8;
    --gray-600: #475569;
    --gray-900: #0f172a;
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;

    /* Modern, premium shadows */
    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
    --shadow-xl: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.header {
    background: radial-gradient(circle at 50% -20%, #003366 0%, var(--navy) 100%);
    color: var(--white);
    padding: 2.5rem 1rem;
    text-align: center;
    border-bottom: 4px solid var(--accent);
    box-shadow: var(--shadow-md);
}

.header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    letter-spacing: -0.03em;
    margin-bottom: 0.25rem;
}

.header .subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    font-weight: 400;
}

.header .secure-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.1);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    margin-top: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

/* Main Container */
.container {
    max-width: 680px;
    margin: 2.5rem auto;
    padding: 0 1.25rem;
}

/* Card */
.card {
    background: var(--white);
    border-radius: 16px;
    box-shadow: var(--shadow-xl);
    padding: 2.5rem;
    margin-bottom: 2rem;
    border: 1px solid var(--gray-200);
    transition: transform 0.2s ease;
}

.card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    color: var(--navy);
    letter-spacing: -0.01em;
}

/* Form Steps */
.step {
    display: none;
}

.step.active {
    display: block;
}

/* Progress Bar (Stepper) */
.progress-bar {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    position: relative;
    padding: 0 1rem;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 10%;
    right: 10%;
    height: 3px;
    background: var(--gray-200);
    transform: translateY(-50%);
    z-index: 0;
}

.progress-step {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--gray-100);
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    font-weight: 700;
    position: relative;
    z-index: 1;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    border: 3px solid var(--white);
    box-shadow: var(--shadow-sm);
}

.progress-step.active {
    background: var(--navy);
    color: var(--white);
    transform: scale(1.15);
    box-shadow: 0 0 0 5px rgba(0, 35, 75, 0.1);
}

.progress-step.completed {
    background: var(--success);
    color: var(--white);
}

/* Form Elements */
.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 0.6rem;
    color: var(--gray-600);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

input,
textarea,
select {
    width: 100%;
    padding: 0.875rem 1.125rem;
    border: 1.5px solid var(--gray-200);
    border-radius: 10px;
    font-size: 1rem;
    font-family: inherit;
    /* Ensure Inter font for all inputs */
    color: var(--gray-900);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: var(--white);
}

input:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

/* Error States */
input.field-error,
textarea.field-error {
    border-color: #ef4444 !important;
    background: #fef2f2;
}

input.field-error:focus,
textarea.field-error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

input::placeholder,
textarea::placeholder {
    color: #cbd5e1;
}

/* Checkbox */
.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    background: var(--gray-50);
    padding: 1.25rem;
    border-radius: 12px;
    border: 1px solid var(--gray-200);
}

.checkbox-group input[type="checkbox"] {
    width: 22px;
    height: 22px;
    margin-top: 0.1rem;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    margin-bottom: 0;
    font-weight: 500;
    color: var(--gray-900);
    text-transform: none;
    letter-spacing: normal;
    font-size: 0.95rem;
    cursor: pointer;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    border-radius: 12px;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    letter-spacing: -0.01em;
}

.btn-primary {
    background: var(--navy);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(0, 35, 75, 0.25);
}

.btn-primary:hover {
    background: var(--hover-navy);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 35, 75, 0.35);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    background: var(--gray-200);
    color: var(--gray-400);
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-secondary {
    background: var(--white);
    color: var(--navy);
    border: 2px solid var(--gray-200);
}

.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--gray-400);
}

.btn-group {
    display: flex;
    gap: 1.25rem;
    margin-top: 2rem;
}

.btn-group .btn {
    flex: 1;
}

/* Alerts */
.alert {
    padding: 1.25rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.6;
    border: 1px solid transparent;
}

.alert-warning {
    background: #fffbeb;
    border: 1px solid #fde68a;
    color: #92400e;
}

.alert-info {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1e40af;
}

.alert-success {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    color: #065f46;
}

.alert-danger {
    background: #fef2f2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

/* Calculation Display */
.calculation {
    background: var(--gray-900);
    border-radius: 12px;
    padding: 1.5rem;
    margin-top: 1.5rem;
    color: var(--white);
}

.calculation-row {
    display: flex;
    justify-content: space-between;
    padding: 0.4rem 0;
    font-size: 0.9rem;
    opacity: 0.8;
}

.calculation-row.total {
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: 0.75rem;
    padding-top: 1rem;
    opacity: 1;
    font-weight: 700;
    font-size: 1.25rem;
    color: var(--white);
}

/* Offer Terms */
.offer-terms {
    background: var(--gray-50);
    border-radius: 12px;
    padding: 1.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    max-height: 350px;
    overflow-y: auto;
    border: 1px solid var(--gray-200);
}

.offer-terms h3 {
    margin-bottom: 1.25rem;
    color: var(--navy);
    font-weight: 700;
}

/* Success Page */
.success-icon {
    width: 80px;
    height: 80px;
    background: var(--success);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 2rem;
    box-shadow: 0 0 20px rgba(16, 185, 129, 0.3);
}

.success-icon svg {
    width: 40px;
    height: 40px;
    stroke: white;
}

/* Admin Dashboard Special Styles */
.admin-header {
    background: var(--navy);
    padding: 2.5rem 2rem;
    color: var(--white);
}

.admin-card {
    max-width: 1200px;
    width: 95%;
}

.admin-table-container {
    overflow-x: auto;
    margin: 0 -2.5rem;
    border-top: 1px solid var(--gray-200);
}

.admin-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.admin-table th {
    background: var(--gray-50);
    padding: 1rem 1.5rem;
    text-align: left;
    color: var(--gray-600);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.75rem;
}

.admin-table td {
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid var(--gray-100);
    color: var(--gray-900);
}

.admin-table tr:hover {
    background: #fdfdfd;
}

.status-badge {
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
}

.status-pending {
    background: #fef3c7;
    color: #92400e;
}

.status-complete {
    background: #d1fae5;
    color: #065f46;
}

.status-error {
    background: #fee2e2;
    color: #991b1b;
}

/* Signature Pad */
.signature-container {
    background: var(--white);
    border: 2px solid var(--gray-200);
    border-radius: 12px;
    overflow: hidden;
    touch-action: none;
    box-shadow: inset var(--shadow-sm);
}

.signature-container canvas {
    display: block;
    width: 100%;
    height: auto;
    cursor: crosshair;
}

.signature-help {
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 0.5rem;
    text-align: center;
}

/* Footer */
.footer {
    text-align: center;
    padding: 4rem 1.25rem;
    color: var(--gray-400);
    font-size: 0.9rem;
    border-top: 1px solid var(--gray-200);
    margin-top: 4rem;
}

.footer-disclaimer p {
    text-align: justify;
    line-height: 1.6;
    margin-bottom: 2rem;
}

.footer-links {
    display: flex;
    justify-content: center;
    gap: 2rem;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    letter-spacing: 0.1em;
}

.consent-block label span {
    color: var(--gray-600);
    line-height: 1.4;
}

.consent-block input[type="checkbox"]:focus {
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.2);
}

/* Responsive */
@media (max-width: 640px) {
    .container {
        margin: 1.5rem auto;
    }

    .card {
        padding: 1.75rem;
        border-radius: 12px;
        margin-bottom: 1.5rem;
    }

    .btn-group {
        flex-direction: column;
    }
}