/* ==========================================================================
   Lite Site - Modern, Minimal & Intuitive Auth Styles
   Inspired by Linear / Stripe / Supabase
   ========================================================================== */

body.auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    margin: 0;
    color: #161022;
    background:
        radial-gradient(ellipse at 50% 0%, rgba(162, 85, 248, 0.15) 0%, transparent 60%),
        radial-gradient(circle at 10% 90%, rgba(116, 43, 185, 0.06) 0%, transparent 50%),
        #faf7fd;
    font-family: Manrope, Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    -webkit-font-smoothing: antialiased;
}

/* Wrapper */
.auth-wrapper {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1 0 auto;
    width: 100%;
    padding: clamp(36px, 6vw, 64px) 20px clamp(32px, 5vw, 50px);
}

.auth-wrapper::before {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(157, 80, 235, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(157, 80, 235, 0.03) 1px, transparent 1px);
    background-size: 36px 36px;
    content: '';
    pointer-events: none;
}

/* Brand Logo */
.auth-brand {
    position: relative;
    z-index: 1;
    display: inline-block;
    margin-bottom: 26px;
    line-height: 0;
    transition: transform .2s ease;
}

.auth-brand:hover {
    transform: scale(1.03);
}

.auth-brand img {
    display: block;
    width: 165px;
    height: auto;
}

/* Auth Card */
.auth-card {
    position: relative;
    z-index: 1;
    width: min(100%, 430px);
    padding: clamp(30px, 5vw, 42px) clamp(22px, 4vw, 36px);
    border: 1px solid rgba(162, 85, 248, 0.2);
    border-radius: 26px;
    background: #ffffff;
    box-shadow: 0 20px 60px rgba(80, 20, 140, 0.07), 0 2px 8px rgba(0, 0, 0, 0.02);
}

.auth-card-wide {
    width: min(100%, 500px);
}

/* Header */
.auth-card-header {
    text-align: center;
    margin-bottom: 26px;
}

.auth-card-header h2 {
    margin: 0 0 8px;
    color: #140e1e;
    font-size: clamp(1.55rem, 2.5vw, 1.85rem);
    font-weight: 920;
    letter-spacing: -.04em;
    line-height: 1.15;
}

.auth-card-header p {
    margin: 0;
    color: #695e74;
    font-size: .92rem;
    line-height: 1.55;
}

/* Icon (e.g. for Forgot Password) */
.auth-card-icon {
    display: grid;
    width: 54px;
    height: 54px;
    margin: 0 auto 16px;
    place-items: center;
    border-radius: 18px;
    color: #742bb9;
    background: #f5edfc;
    border: 1px solid rgba(157, 80, 235, 0.2);
    font-size: 1.45rem;
    box-shadow: 0 6px 18px rgba(116, 43, 185, 0.1);
}

.auth-card-icon-danger {
    color: #dc2626;
    background: #fef2f2;
    border-color: rgba(220, 38, 38, 0.2);
}

/* Inputs & Form Groups */
.form-group {
    position: relative;
}

.auth-card .form-label,
.form-label {
    display: block;
    margin-bottom: 7px;
    color: #2c2337 !important;
    font-size: .85rem;
    font-weight: 750;
    letter-spacing: -.01em;
}

.input-with-icon {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 15px;
    color: #978c9f;
    font-size: 1.05rem;
    pointer-events: none;
    transition: color .18s ease;
    z-index: 2;
}

.auth-card .form-control,
.form-control {
    min-height: 48px;
    padding: 11px 16px;
    border: 1.5px solid #ded3e8 !important;
    border-radius: 13px !important;
    color: #161022 !important;
    background-color: #fbf9fd !important;
    font-family: inherit;
    font-size: .92rem;
    font-weight: 600;
    transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
    width: 100%;
}

.input-with-icon .form-control {
    padding-left: 42px;
}

.auth-card .form-control::placeholder,
.form-control::placeholder {
    color: #8c8297 !important;
    font-weight: 500;
    opacity: 1;
}

.auth-card .form-control:focus,
.form-control:focus {
    border-color: #8e3ee0 !important;
    color: #161022 !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 4px rgba(142, 62, 224, 0.13) !important;
    outline: none !important;
}

.auth-card .form-control:-webkit-autofill,
.auth-card .form-control:-webkit-autofill:hover,
.auth-card .form-control:-webkit-autofill:focus,
.form-control:-webkit-autofill,
.form-control:-webkit-autofill:hover,
.form-control:-webkit-autofill:focus {
    -webkit-text-fill-color: #161022 !important;
    -webkit-box-shadow: 0 0 0px 1000px #fbf9fd inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

.input-with-icon:focus-within .input-icon {
    color: #742bb9;
}

.auth-card .form-control.is-invalid,
.form-control.is-invalid {
    border-color: #dc2626 !important;
    background-color: #fef2f2 !important;
}

.invalid-feedback {
    font-size: .78rem;
    font-weight: 700;
    color: #dc2626;
    margin-top: 5px;
}

/* Password Toggle */
.password-toggle {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #978c9f;
    font-size: 1.15rem;
    padding: 6px 10px;
    cursor: pointer;
    text-decoration: none;
    z-index: 2;
    transition: color .18s ease;
}

.password-toggle:hover {
    color: #742bb9;
}

/* Primary Button */
.btn-codeef {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    min-height: 50px;
    padding: 12px 24px;
    border: none;
    border-radius: 13px;
    color: #ffffff !important;
    background: linear-gradient(135deg, #9d50eb 0%, #742bb9 100%);
    box-shadow: 0 10px 24px rgba(116, 43, 185, 0.28);
    font-size: .93rem;
    font-weight: 850;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.btn-codeef:hover {
    transform: translateY(-2px);
    background: linear-gradient(135deg, #ad66ef 0%, #7c35c9 100%);
    box-shadow: 0 14px 30px rgba(116, 43, 185, 0.36);
}

/* Google Button */
.btn-google {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 48px;
    padding: 11px 20px;
    border: 1.5px solid #ded3e8;
    border-radius: 13px;
    background: #ffffff;
    color: #383042;
    font-size: .88rem;
    font-weight: 800;
    text-decoration: none;
    cursor: pointer;
    transition: background .18s ease, border-color .18s ease, transform .18s ease;
}

.btn-google:hover:not(:disabled) {
    background: #faf6fe;
    border-color: #8e3ee0;
    color: #6a1ebb;
    transform: translateY(-1px);
}

.btn-google:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.btn-google.is-terms-unaccepted {
    border-style: dashed;
    border-color: #d1bfe4;
    background: #faf7fd;
    color: #635870;
}

.btn-google.is-terms-unaccepted:hover {
    border-color: #8e3ee0;
    background: #f5effc;
    color: #4b1a85;
}

.google-mark {
    display: grid;
    place-items: center;
    width: 20px;
    height: 20px;
    font-weight: 900;
    font-size: .95rem;
    color: #742bb9;
}

.auth-google-wrapper {
    position: relative;
}

.auth-google-terms-hint {
    margin-top: 8px;
    font-size: .78rem;
    font-weight: 700;
    line-height: 1.4;
    color: #7b6f89;
    text-align: center;
    padding: 0 4px;
}

.auth-google-terms-hint .hint-waiting i {
    color: #742bb9;
    margin-right: 4px;
}

.auth-google-terms-hint .hint-ready i {
    margin-right: 4px;
}

/* Divider */
.auth-divider {
    position: relative;
    text-align: center;
    margin: 20px 0;
}

.auth-divider::before {
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #ede3f5;
    content: '';
}

.auth-divider span {
    position: relative;
    display: inline-block;
    padding: 0 14px;
    background: #ffffff;
    color: #8e8399;
    font-size: .76rem;
    font-weight: 750;
}

/* Links & Footer */
.auth-forgot-link {
    color: #742bb9;
    font-size: .84rem;
    font-weight: 750;
    text-decoration: none;
    transition: color .18s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.auth-forgot-link:hover {
    color: #9d50eb;
    text-decoration: underline;
}

.auth-card-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #f2e9f6;
    font-size: .86rem;
    color: #695e74;
    text-align: center;
}

.auth-signup-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-wrap: wrap;
    font-size: .86rem;
    color: #695e74;
}

.auth-card-footer a,
.auth-back-link {
    color: #742bb9;
    font-weight: 850;
    text-decoration: none;
    transition: color .18s ease;
}

.auth-card-footer a:hover,
.auth-back-link:hover {
    color: #9d50eb;
    text-decoration: underline;
}

.auth-back-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    font-size: .84rem;
}

/* Terms Card */
.auth-terms-card {
    padding: 12px 14px;
    border-radius: 14px;
    background: #fbf8fe;
    border: 1.5px solid #ded3e8;
    transition: border-color .2s ease, box-shadow .2s ease, background .2s ease;
}

.auth-terms-card.auth-terms-highlight {
    border-color: #8e3ee0;
    background: #f7effd;
    box-shadow: 0 0 0 4px rgba(142, 62, 224, 0.22);
    animation: termsWiggle .42s ease-in-out;
}

.auth-terms-card.is-invalid {
    border-color: #dc2626;
    background: #fef2f2;
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
}

@keyframes termsWiggle {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.auth-terms-check {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    cursor: pointer;
}

.auth-terms-check .form-check-input {
    flex: 0 0 auto;
    margin-top: 3px;
    border-color: #cbbad9;
    background-color: #ffffff;
    cursor: pointer;
}

.auth-terms-check .form-check-input:checked {
    border-color: #742bb9;
    background-color: #742bb9;
}

.auth-terms-text {
    font-size: .8rem;
    line-height: 1.45;
    color: #4b4058;
    font-weight: 600;
}

.auth-terms-text a {
    color: #742bb9;
    font-weight: 800;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.auth-terms-text a:hover {
    color: #9d50eb;
}

.auth-terms-error {
    margin-top: 6px;
    padding-left: 26px;
    color: #dc2626;
    font-size: .74rem;
    font-weight: 750;
}

/* 2FA Code Input Styling */
.two-factor-code-input {
    text-align: center;
    font-size: 1.8rem !important;
    font-weight: 900 !important;
    letter-spacing: .35em !important;
    color: #742bb9 !important;
    padding-left: 16px !important;
}

/* Legal Footer */
.auth-legal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    min-height: 60px;
    padding: 16px clamp(20px, 5vw, 64px);
    border-top: 1px solid #ede3f5;
    background: #ffffff;
    font-size: .78rem;
}

.auth-legal-footer nav {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
}

.auth-legal-footer nav a {
    color: #695e74;
    font-size: .78rem;
    font-weight: 750;
    text-decoration: none;
    transition: color .18s ease;
}

.auth-legal-footer nav a:hover {
    color: #742bb9;
}

.auth-codeef-signature {
    display: block;
    text-decoration: none;
}

.auth-codeef-logo {
    display: block;
    width: 125px;
    height: auto;
}

.auth-codeef-logo img {
    display: block;
    width: 100%;
    height: auto;
}

/* Responsive */
@media (max-width: 520px) {
    .auth-wrapper {
        padding-inline: 16px;
    }
    .auth-card {
        padding: 28px 20px;
        border-radius: 22px;
    }
    .auth-legal-footer {
        flex-direction: column;
        align-items: center;
        gap: 12px;
        text-align: center;
    }
}
