/* PDQ Restoration — Login (split layout matching brand mockup) */

:root {
    --pdq-green: #4E7D26;
    --pdq-green-hover: #15803D;
    --pdq-blue: #2563EB;
    --pdq-dark-text: #0F172A;
    --pdq-muted: #64748B;
    --pdq-input-border: #CBD5E1;
    --pdq-panel: #F8FAFC;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
    padding: 0;
    background-color: #FFFFFF;
    font-family: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    color: var(--pdq-dark-text);
    overflow-x: hidden;
}

.login-fullscreen-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
    padding: 0;
    background-color: #FFFFFF;
    gap: 0;
}

/*
 * Failsafe: if a full auth shell was wrongly HTMX-swapped into the form card,
 * hide the nested showcase so the page stays usable until a full navigation.
 */
.form-content-center .login-fullscreen-wrapper,
#login-form-card .login-fullscreen-wrapper,
#forgot-form-card .login-fullscreen-wrapper,
#reset-form-card .login-fullscreen-wrapper {
    display: block;
    min-height: 0;
    width: 100%;
}

.form-content-center .showcase-card,
#login-form-card .showcase-card,
#forgot-form-card .showcase-card,
#reset-form-card .showcase-card {
    display: none !important;
}

.form-content-center .form-container,
#login-form-card .form-container,
#forgot-form-card .form-container,
#reset-form-card .form-container {
    width: 100%;
    padding: 0;
    background: transparent;
}

.form-content-center .device_logo,
.form-content-center .form-footer,
#login-form-card .device_logo,
#login-form-card .form-footer,
#forgot-form-card .device_logo,
#forgot-form-card .form-footer,
#reset-form-card .device_logo,
#reset-form-card .form-footer {
    display: none;
}

.form-container,
.showcase-card {
    flex: 1 1 0;
    width: 50%;
    min-width: 0;
}

.form-container {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: stretch;
    padding: 1.75rem 3.5rem 1.5rem 4rem;
    background-color: #EFF6FF;
}

.brand-logo-img {
    height: 140px;
    max-height: 140px;
    width: auto;
    max-width: 420px;
    object-fit: contain;
    mix-blend-mode: multiply;
    transition: transform 0.2s ease;
}

.brand-logo-img:hover {
    transform: scale(1.02);
}

.form-content-center {
    margin: auto;
    padding: 1.5rem 0;
    width: 100%;
    max-width: 420px;
    align-self: center;
}

.login-title {
    font-size: 2.15rem;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.03em;
    margin: 0 0 0.35rem;
    line-height: 1.15;
}

.login-subtitle {
    font-size: 0.95rem;
    color: var(--pdq-muted);
    margin: 0 0 2rem;
    font-weight: 400;
}

.custom-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: #334155;
    margin-bottom: 0.4rem;
    display: block;
}

.input-wrapper {
    position: relative;
    display: block;
    width: 100%;
}

.input-wrapper input[type="password"]::-ms-reveal,
.input-wrapper input[type="password"]::-ms-clear {
    display: none;
}

.input-wrapper:has(.password-toggle-btn) .custom-input,
.input-wrapper:has(.pdq-password-toggle) .custom-input {
    padding-right: 2.75rem !important;
}

.input-icon {
    position: absolute;
    left: 0.95rem;
    top: 50%;
    transform: translateY(-50%);
    color: #94A3B8;
    font-size: 1.05rem;
    line-height: 1;
    pointer-events: none;
    z-index: 2;
}

.custom-input {
    display: block;
    width: 100%;
    height: 48px;
    background: #FFFFFF !important;
    border: 1px solid var(--pdq-input-border) !important;
    border-radius: 10px !important;
    padding: 0 1rem 0 2.7rem !important;
    color: #0F172A !important;
    font-size: 0.925rem;
    line-height: normal;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#input-password.custom-input {
    padding-right: 2.75rem !important;
}

.custom-input::placeholder {
    color: #94A3B8 !important;
    font-weight: 400;
}

.custom-input:focus {
    border-color: #93C5FD !important;
    box-shadow: 0 0 0 3px rgba(46, 144, 250, 0.18) !important;
    outline: none;
}

/* Auth: password toggle uses shared .pdq-password-toggle look */
.input-wrapper .password-toggle-btn,
.input-wrapper .pdq-password-toggle {
    position: absolute;
    right: 0.45rem;
    top: 50%;
    transform: translateY(-50%);
    width: 2.1rem;
    height: 2.1rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    border-radius: 999px;
    color: #64748B;
    cursor: pointer;
    padding: 0;
    font-size: 1.1rem;
    line-height: 1;
    z-index: 3;
    opacity: 0.55;
    transition: opacity 0.15s ease, color 0.15s ease, background-color 0.15s ease, transform 0.12s ease;
}

.input-wrapper.is-active .password-toggle-btn,
.input-wrapper:focus-within .password-toggle-btn,
.input-wrapper.is-active .pdq-password-toggle,
.input-wrapper:focus-within .pdq-password-toggle,
.input-wrapper .password-toggle-btn.is-on,
.input-wrapper .pdq-password-toggle.is-on {
    opacity: 1;
}

.input-wrapper .password-toggle-btn:hover,
.input-wrapper .pdq-password-toggle:hover {
    color: #0F172A;
    background: #F1F5F9;
    opacity: 1;
}

.input-wrapper .password-toggle-btn.is-on,
.input-wrapper .pdq-password-toggle.is-on {
    color: #2563EB;
}

.input-wrapper .password-toggle-btn:active,
.input-wrapper .pdq-password-toggle:active {
    transform: translateY(-50%) scale(0.92);
}

.input-wrapper .password-toggle-btn:focus-visible,
.input-wrapper .pdq-password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.25);
    color: #2563EB;
    background: #EFF6FF;
    opacity: 1;
}

.remember-row {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    margin-top: 0.7rem;
    margin-bottom: 1.5rem;
}

.custom-check-input {
    width: 1rem;
    height: 1rem;
    border-radius: 4px;
    border: 1px solid #CBD5E1;
    cursor: pointer;
}

.custom-check-input:checked {
    background-color: var(--pdq-green);
    border-color: var(--pdq-green);
}

.custom-check-label {
    font-size: 0.875rem;
    color: #64748B;
    cursor: pointer;
    user-select: none;
    margin-left: 0.4rem;
}

.btn-pdq-login {
    width: 100%;
    height: 50px;
    background-color: #2563EB;
    border: none;
    color: #FFFFFF;
    font-weight: 600;
    font-size: 1rem;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: background-color 0.15s ease, transform 0.1s ease;
}

.btn-pdq-login:hover:not(:disabled) {
    background-color: #1D4ED8;
    color: #FFFFFF;
}

.btn-pdq-login:active:not(:disabled) {
    transform: translateY(1px);
}

.btn-pdq-login:disabled {
    opacity: 0.75;
    cursor: wait;
}

.forgot-pass-wrap {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.875rem;
    color: #64748B;
}

.forgot-pass-link {
    color: var(--pdq-blue);
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-otp {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem;
    width: 100%;
}

.auth-otp-digit {
    flex: 1 1 0;
    min-width: 0;
    width: 100%;
    max-width: 3.25rem;
    height: 52px;
    margin: 0 auto;
    text-align: center;
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: 0;
    color: #0F172A;
    background: #FFFFFF;
    border: 1px solid var(--pdq-input-border);
    border-radius: 10px;
    caret-color: var(--pdq-green);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.auth-otp-digit:focus {
    border-color: #93C5FD;
    box-shadow: 0 0 0 3px rgba(46, 144, 250, 0.18);
    outline: none;
}

.auth-otp-digit.is-invalid {
    border-color: #F87171;
}

.forgot-pass-link:hover {
    color: #1D4ED8;
}

.auth-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    border-radius: 10px;
    font-size: 0.85rem;
    line-height: 1.45;
    margin-bottom: 1rem;
}

.auth-alert i {
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.auth-alert-danger {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #DC2626;
}

.auth-alert-success {
    background: rgba(22, 163, 74, 0.1);
    border: 1px solid rgba(22, 163, 74, 0.25);
    color: #15803D;
}

.pdq-password-rules {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.45rem;
    width: 100%;
}

.pdq-password-chip {
    display: inline-flex;
    align-items: center;
    padding: 0.1rem 0.45rem;
    border-radius: 999px;
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    line-height: 1.35;
    border: 1px solid transparent;
    user-select: none;
}

.pdq-password-chip.is-unmet {
    color: #64748B;
    background: #F1F5F9;
    border-color: #E2E8F0;
}

.pdq-password-chip.is-met {
    color: #166534;
    background: #DCFCE7;
    border-color: #BBF7D0;
}

.form-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding-top: 1rem;
    font-size: 0.8rem;
    color: #94A3B8;
}

.privacy-link {
    color: #64748B;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.privacy-link:hover {
    color: #334155;
}

/* Right showcase panel — diagram sits flush on the green (no framed “card” image) */
.showcase-card {
    background-color: #F0FDF4;
    border-left: 1px solid #D1FAE5;
    padding: 1.25rem 0.75rem 1.75rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
    min-height: 100vh;
}

.pdq-diagram-wrap {
    flex: 1 1 auto;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    padding: 0;
    margin: 0;
}

.pdq-drying-diagram-img {
    display: block;
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: calc(100vh - 8.5rem);
    object-fit: contain;
    border: none;
    border-radius: 0;
    box-shadow: none;
    background: transparent;
}

.showcase-bottom-wrap {
    z-index: 5;
    position: relative;
    max-width: 520px;
    padding: 0.35rem 1rem 0;
}

.guarantee-title {
    font-size: 1.45rem;
    font-weight: 700;
    color: #0F172A;
    letter-spacing: -0.02em;
    margin: 0 0 0.45rem;
}

.guarantee-desc {
    font-size: 0.9rem;
    color: #64748B;
    line-height: 1.55;
    margin: 0;
}

@media (max-width: 1100px) {
    .form-container {
        padding: 1.5rem 2rem;
    }
}

@media (max-width: 992px) {
    .login-fullscreen-wrapper {
        flex-direction: column-reverse;
        padding: 0.75rem;
        gap: 0.75rem;
    }

    .form-container,
    .showcase-card {
        flex: 1 1 auto;
        width: 100%;
    }

    .form-container {
        padding: 1.25rem 1rem 1rem;
        border-radius: 18px;
    }

    .showcase-card {
        width: 100%;
        min-height: auto;
        padding: 0.75rem 0.25rem 1.25rem;
        border-radius: 18px;
        border-left: none;
        border: 1px solid #D1FAE5;
    }

    .form-content-center {
        max-width: 100%;
    }

    .pdq-drying-diagram-img {
        max-height: 380px;
    }

    .login-title {
        font-size: 1.75rem;
    }
}

@media (max-width: 576px) {
    .device_logo {
        display: flex;
        justify-content: center;
    }

    .brand-logo-img {
        height: 96px;
        max-height: 96px;
        max-width: 300px;
    }

    .auth-otp {
        gap: 0.35rem;
    }

    .auth-otp-digit {
        height: 46px;
        font-size: 1.1rem;
        max-width: none;
    }

    .guarantee-title {
        font-size: 1.2rem;
    }

    .pdq-drying-diagram-img {
        max-height: 280px;
    }
}
