/* Local Fonts */
@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../assets/fonts/PlusJakartaSans-Light.woff2") format("woff2");
    font-weight: 300;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../assets/fonts/PlusJakartaSans-Regular.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: "Plus Jakarta Sans";
    src: url("../assets/fonts/PlusJakartaSans-Bold.woff2") format("woff2");
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

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

html {
    font-size: 12px;
}

body {
    font-family: "Plus Jakarta Sans", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    color: #283250;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Split-screen layout */
.container {
    display: flex;
    min-height: 100vh;
}

/* Left Panel */
.panel-left {
    flex: 1;
    background-color: #283250;
    display: flex;
    align-items: center;
    padding: 2rem;
}

.panel-left-content {
    max-width: 444px;
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 1.5rem;
}

.brand-name {
    font-size: 2.125rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
}

.panel-title {
    font-size: 3rem;
    font-weight: 700;
    color: #fff;
    white-space: nowrap;
    overflow: visible;
    margin-bottom: 2rem;
}

.panel-description {
    font-size: 1.5rem;
    color: #fff;
    line-height: 1.5;
}

/* Right Panel */
.panel-right {
    flex: 1;
    min-width: 50vw;
    background-color: #f9f9fb;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Form Grid */
.form-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
}

.form-field.half {
    flex: 1 1 calc(50% - 8px);
    min-width: 200px;
}

.form-field.full {
    flex: 1 1 100%;
}

/* =====================
   Floating Labels
   ===================== */
.floating-group {
    position: relative;
}

.floating-group label {
    position: absolute;
    left: 14px;
    top: 10px;
    font-size: 1rem;
    color: rgba(0, 0, 0, 0.65);
    pointer-events: none;
    transition: all 0.2s ease;
    background: #fff;
    padding: 0 4px;
}

/* Float up when input is focused or has content */
.floating-group input:focus ~ label,
.floating-group input:not(:placeholder-shown) ~ label,
.floating-group textarea:focus ~ label,
.floating-group textarea:not(:placeholder-shown) ~ label {
    top: -8px;
    left: 10px;
    font-size: 0.85rem;
    color: rgb(28, 32, 69);
}

/* Inputs & Textarea */
input[type="text"],
input[type="email"],
textarea {
    width: 100%;
    padding: 12px 14px;
    font-family: "Plus Jakarta Sans", Arial, sans-serif;
    font-size: 1rem;
    line-height: 1.5;
    border: 1.5px solid rgb(180, 180, 180);
    border-radius: 0;
    background-color: #fff;
    color: #111;
    outline: none;
    transition: border-color 0.2s;
}

input[type="text"]:focus,
input[type="email"]:focus,
textarea:focus {
    border-color: rgb(28, 32, 69);
    border-width: 2px;
    padding: 11px 13px;
}

textarea {
    resize: vertical;
}

/* =====================
   Inline Validation
   ===================== */
.field-error {
    display: block;
    min-height: 18px;
    font-size: 0.9rem;
    color: #be242d;
    padding-top: 3px;
    opacity: 0;
    transition: opacity 0.2s;
}

.field-error.visible {
    opacity: 1;
}

/* Red border on invalid touched fields */
.floating-group.touched input:invalid,
.floating-group.touched textarea:invalid {
    border-color: #be242d;
}

.floating-group.touched input:invalid ~ label,
.floating-group.touched textarea:invalid ~ label {
    color: #be242d;
}

/* Green border on valid touched fields */
.floating-group.touched input:valid,
.floating-group.touched textarea:valid {
    border-color: #2e7d32;
}

.floating-group.touched input:valid ~ label,
.floating-group.touched textarea:valid ~ label {
    color: #2e7d32;
}

/* Override green/red when actively focused — use primary color */
.floating-group input:focus,
.floating-group textarea:focus {
    border-color: rgb(28, 32, 69);
}

.floating-group input:focus ~ label,
.floating-group textarea:focus ~ label {
    color: rgb(28, 32, 69);
}

/* GDPR Text */
.gdpr-text {
    font-size: 1rem;
    line-height: 1.5;
    color: rgba(0, 0, 0, 0.87);
}

.gdpr-text a {
    color: #283250;
}

/* Captcha */
.captcha-field {
    padding-top: 16px;
    padding-bottom: 16px;
}

altcha-widget {
    --altcha-border-radius: 0;
}

/* Error message (global) */
.error {
    color: #be242d;
    font-size: 1rem;
    margin-top: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: max-height 0.3s, opacity 0.3s;
}

.error.visible {
    max-height: 60px;
    opacity: 1;
}

/* =====================
   Confirmation (fade in)
   ===================== */
.confirmation {
    font-size: 1.25rem;
    color: rgba(0, 0, 0, 0.87);
    display: none;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.confirmation.show {
    display: block;
    opacity: 1;
}

/* =====================
   Submit Button + Spinner
   ===================== */
.submit-btn {
    height: 60px;
    width: 180px;
    border: 1px solid #3A3871;
    border-radius: 0;
    background-color: #283250;
    color: #fff;
    font-family: "Plus Jakarta Sans", Arial, sans-serif;
    font-size: 1.35rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: none;
    text-transform: none;
    transition: background-color 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.submit-btn:hover {
    background-color: #1c2040;
}

.submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

.submit-btn.loading .btn-text {
    display: none;
}

.submit-btn.loading .btn-spinner {
    display: block;
}

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

/* =====================
   Shake animation (errors)
   ===================== */
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20% { transform: translateX(-6px); }
    40% { transform: translateX(6px); }
    60% { transform: translateX(-4px); }
    80% { transform: translateX(4px); }
}

.shake {
    animation: shake 0.4s ease;
}

/* =====================
   Responsive
   ===================== */
@media (max-width: 900px) {
    .container {
        flex-direction: column;
    }

    .panel-left {
        min-height: auto;
        padding: 2rem;
    }

    .panel-right {
        min-width: unset;
        min-height: 60vh;
    }

    .form-field.half {
        flex: 1 1 100%;
    }
}
