/* === Reset & Base === */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 300;
    background: #1a1a1a;
    color: #e8e2dc;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    font-size: 14px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* === Animations === */
@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(12px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes checkmarkDraw {
    to {
        stroke-dashoffset: 0;
    }
}

@keyframes scaleIn {
    from {
        transform: scale(0.8);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* === Header === */
.site-header {
    text-align: center;
    padding: 40px 20px 20px;
}

.header-brand {
    line-height: 0;
}

.logo-img {
    height: 48px;
    width: auto;
    opacity: 0.9;
}

/* === Page Intro === */
.page-intro {
    text-align: center;
    padding: 20px 20px 10px;
    max-width: 600px;
    margin: 0 auto;
    transition: opacity 0.35s ease, max-height 0.4s ease, padding 0.4s ease, margin 0.4s ease;
    overflow: hidden;
    max-height: 300px;
}

.page-intro.hidden {
    opacity: 0;
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    margin-top: 0;
    margin-bottom: 0;
    pointer-events: none;
}

.intro-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #e8e2dc;
    opacity: 0.6;
    display: block;
    margin-bottom: 14px;
}

.page-intro h1 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 32px;
    color: #e8e2dc;
    margin-bottom: 10px;
    line-height: 1.3;
}

.intro-text {
    font-size: 13px;
    font-weight: 300;
    color: #e8e2dc;
    opacity: 0.6;
    line-height: 1.6;
}

/* === Main Content === */
.main-content {
    flex: 1;
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

/* === Progress Bar === */
.progress-bar {
    width: 100%;
    height: 2px;
    background: #333;
    margin: 20px 0 8px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: #e8e2dc;
    width: 20%;
    transition: width 0.4s ease;
}

.step-indicator {
    text-align: center;
    font-size: 11px;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: #e8e2dc;
    opacity: 0.5;
    margin-bottom: 24px;
}

/* === Form Container === */
.form-container {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid #333;
    padding: 50px 40px;
}

/* === Form Sections === */
.form-section {
    display: none;
}

.form-section.active {
    display: block;
    animation: fadeUp 0.35s ease both;
}

/* === Headings === */
.form-section h2 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 26px;
    color: #e8e2dc;
    margin-bottom: 30px;
    padding-bottom: 16px;
    border-bottom: 1px solid #333;
}

.form-section h3 {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 400;
    font-style: italic;
    font-size: 18px;
    color: #e8e2dc;
    margin-top: 28px;
    margin-bottom: 18px;
    opacity: 0.85;
}

/* === Field Groups === */
.field-group {
    margin-bottom: 24px;
}

.field-label {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 14px;
    font-weight: 400;
    color: #e8e2dc;
    opacity: 0.8;
    margin-bottom: 8px;
}

.required {
    color: #c0504e;
}

.field-hint {
    display: block;
    font-size: 12px;
    font-weight: 300;
    color: #e8e2dc;
    opacity: 0.45;
    margin-bottom: 8px;
    font-style: italic;
}

/* === Inputs === */
.field-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #444;
    padding: 10px 0;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: #e8e2dc;
    outline: none;
    transition: border-bottom-color 0.3s ease;
    appearance: none;
    -webkit-appearance: none;
}

.field-input:focus {
    border-bottom-color: #e8e2dc;
}

.field-input::placeholder {
    color: #e8e2dc;
    opacity: 0.3;
}

/* Select styling */
select.field-input {
    cursor: pointer;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23e8e2dc' 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 4px center;
    padding-right: 24px;
}

select.field-input option {
    background: #2a2a2a;
    color: #e8e2dc;
}

/* Date input */
input[type="date"].field-input {
    cursor: pointer;
}

input[type="date"].field-input::-webkit-calendar-picker-indicator {
    filter: invert(0.85);
    cursor: pointer;
}

/* === Textarea === */
.field-textarea {
    width: 100%;
    background: transparent;
    border: 1px solid #444;
    padding: 12px;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 300;
    color: #e8e2dc;
    outline: none;
    resize: vertical;
    min-height: 80px;
    transition: border-color 0.3s ease;
    line-height: 1.6;
}

.field-textarea:focus {
    border-color: #e8e2dc;
}

.field-textarea::placeholder {
    color: #e8e2dc;
    opacity: 0.3;
}

/* === Validation States === */
.field-input.valid,
.field-textarea.valid {
    border-bottom-color: #6b9e6f;
}

.field-textarea.valid {
    border-color: #6b9e6f;
}

.field-input.invalid,
.field-textarea.invalid {
    border-bottom-color: #c0504e;
}

.field-textarea.invalid {
    border-color: #c0504e;
}

/* === Phone Row === */
.phone-row {
    display: flex;
    gap: 10px;
    align-items: flex-end;
}

.phone-code {
    width: 120px;
    min-width: 120px;
    flex-shrink: 0;
}

.phone-number {
    flex: 1;
}

/* === Field Row (side by side) === */
.field-row {
    display: flex;
    gap: 20px;
}

.field-row .field-group {
    flex: 1;
}

/* === Radio Groups === */
.radio-group {
    display: flex;
    gap: 24px;
    margin-top: 4px;
}

.radio-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 300;
}

.radio-label input[type="radio"] {
    display: none;
}

.radio-custom {
    width: 18px;
    height: 18px;
    border: 1px solid #555;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
    transition: border-color 0.3s ease;
}

.radio-label input[type="radio"]:checked + .radio-custom {
    border-color: #e8e2dc;
}

.radio-label input[type="radio"]:checked + .radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background: #e8e2dc;
    border-radius: 50%;
}

/* === Checkbox === */
.checkbox-group {
    margin-bottom: 18px;
}

.checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
    display: none;
}

.checkbox-custom {
    width: 18px;
    height: 18px;
    min-width: 18px;
    border: 1px solid #555;
    position: relative;
    flex-shrink: 0;
    margin-top: 1px;
    transition: border-color 0.3s ease, background-color 0.3s ease;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom {
    border-color: #e8e2dc;
    background: #e8e2dc;
}

.checkbox-label input[type="checkbox"]:checked + .checkbox-custom::after {
    content: '';
    position: absolute;
    top: 2px;
    left: 5px;
    width: 5px;
    height: 9px;
    border: solid #1a1a1a;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-label .contract-link {
    color: #c9a96e;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.checkbox-label .contract-link:hover {
    color: #e0c48a;
}

/* === Note Box === */
.note-box {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 15px;
    line-height: 1.7;
    color: #e8e2dc;
    opacity: 0.7;
    border-left: 2px solid #444;
    padding: 12px 0 12px 20px;
    margin-bottom: 28px;
}

/* === Contract Box === */
.contract-box {
    background: rgba(255, 255, 255, 0.03);
    border-left: 2px solid #444;
    padding: 20px 24px;
    margin-bottom: 30px;
    font-size: 13px;
    font-weight: 300;
    line-height: 1.8;
    color: #e8e2dc;
    opacity: 0.8;
}

/* === Section Divider === */
.section-divider {
    height: 1px;
    background: #333;
    margin: 32px 0;
}

/* === Buttons === */
.form-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 36px;
    padding-top: 24px;
    border-top: 1px solid #333;
}

.btn {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    padding: 14px 32px;
    border: none;
    border-radius: 0;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
}

.btn-primary {
    background: #e8e2dc;
    color: #1a1a1a;
}

.btn-primary:hover {
    background: #fff;
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-back {
    background: transparent;
    color: #e8e2dc;
    border: 1px solid #e8e2dc;
}

.btn-back:hover {
    background: #e8e2dc;
    color: #1a1a1a;
}

/* === Success Page === */
.success-page {
    text-align: center;
    padding: 40px 20px;
    animation: fadeUp 0.5s ease both;
}

.success-icon {
    width: 64px;
    height: 64px;
    border: 2px solid #6b9e6f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    animation: scaleIn 0.4s ease both;
}

.success-icon svg {
    width: 28px;
    height: 28px;
    color: #6b9e6f;
    stroke-dasharray: 30;
    stroke-dashoffset: 30;
    animation: checkmarkDraw 0.5s ease 0.3s forwards;
}

.success-label {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #e8e2dc;
    opacity: 0.6;
    display: block;
    margin-bottom: 12px;
}

.success-title {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 300;
    font-size: 28px;
    color: #e8e2dc;
    margin-bottom: 16px;
    border: none !important;
    padding: 0 !important;
}

.success-text {
    font-size: 13px;
    font-weight: 300;
    color: #e8e2dc;
    opacity: 0.7;
    line-height: 1.7;
    max-width: 420px;
    margin: 0 auto 28px;
}

.success-divider {
    width: 40px;
    height: 1px;
    background: #444;
    margin: 0 auto 24px;
}

.success-names {
    font-family: 'Cormorant Garamond', serif;
    font-style: italic;
    font-size: 20px;
    color: #e8e2dc;
    margin-bottom: 4px;
}

.success-brand {
    font-family: 'Montserrat', sans-serif;
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #e8e2dc;
    opacity: 0.5;
}

/* === Footer === */
.site-footer {
    text-align: center;
    padding: 30px 20px;
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 2px;
    color: #e8e2dc;
    opacity: 0.4;
}

/* === Loading State === */
.btn-submit.loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-submit.loading::after {
    content: '';
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid #1a1a1a;
    border-right-color: transparent;
    border-radius: 50%;
    margin-left: 8px;
    vertical-align: middle;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === Signature Pad === */
.signature-pad-wrapper {
    position: relative;
    border: 1px solid #444;
    background: rgba(255,255,255,0.03);
    margin-top: 8px;
    transition: border-color 0.3s ease;
}
.signature-pad-wrapper:hover {
    border-color: #666;
}
.signature-pad-wrapper canvas {
    width: 100%;
    height: 200px;
    display: block;
    cursor: crosshair;
    touch-action: none;
}
.signature-clear-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    background: rgba(26,26,26,0.7);
    border: 1px solid #555;
    color: #999;
    font-family: 'Montserrat', sans-serif;
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 2px;
    padding: 6px 14px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.signature-clear-btn:hover {
    border-color: #e8e2dc;
    color: #e8e2dc;
}
.signature-error {
    color: #c0504e;
    font-size: 12px;
    margin-top: 8px;
}
.signature-pad-wrapper.has-error {
    border-color: #c0504e;
}
.signature-pad-wrapper.has-signature {
    border-color: #6b9e6f;
}

/* === Mobile Responsive === */
@media (max-width: 600px) {
    .form-container {
        padding: 30px 20px;
    }

    .page-intro h1 {
        font-size: 26px;
    }

    .form-section h2 {
        font-size: 22px;
    }

    .field-row {
        flex-direction: column;
        gap: 0;
    }

    .phone-code {
        width: 110px;
        min-width: 110px;
    }

    .form-nav {
        flex-direction: column-reverse;
        gap: 12px;
    }

    .form-nav .btn {
        width: 100%;
        text-align: center;
    }

    .btn {
        padding: 14px 24px;
    }

    .site-header {
        padding: 30px 20px 16px;
    }
}
