/* ==========================================================================
   auth.css — shared layout for Login / Create Account
   ========================================================================== */

body {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: clamp(16px, 4vw, 48px);
    background:
        radial-gradient(70% 60% at 100% 0%, rgba(201, 131, 47, .28) 0%, rgba(201, 131, 47, 0) 60%),
        radial-gradient(60% 60% at 0% 100%, rgba(196, 84, 31, .30) 0%, rgba(196, 84, 31, 0) 60%),
        #1f1510;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    z-index: 0;
    background-image: var(--star-pattern);
    pointer-events: none;
}

/* floating symbols */
.bg-decoration {
    position: fixed;
    z-index: 0;
    color: #fff;
    opacity: .06;
    pointer-events: none;
    user-select: none;
}

.zodiac-symbol {
    font-family: var(--font-display);
    font-size: clamp(80px, 12vw, 160px);
    line-height: 1;
    animation: authFloat 18s ease-in-out infinite;
}

.zodiac-symbol:nth-child(1) { top: 6%; left: 6%; }
.zodiac-symbol:nth-child(2) { bottom: 8%; right: 8%; animation-delay: 5s; }
.zodiac-symbol:nth-child(3) { top: 40%; right: 30%; animation-delay: 9s; font-size: 70px; }

@keyframes authFloat {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    50% { transform: translateY(-24px) rotate(12deg); }
}

/* ---------- Card ---------- */
.login-container,
.registration-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    width: 100%;
    max-width: 1080px;
    overflow: hidden;
    border-radius: var(--radius-xl);
    background: #fff;
    box-shadow: 0 40px 100px -30px rgba(0, 0, 0, .65);
}

/* ---------- Brand panel ---------- */
.left-panel {
    position: relative;
    isolation: isolate;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: clamp(36px, 5vw, 64px) clamp(26px, 4vw, 52px);
    background: var(--grad-hero);
    color: rgba(255, 244, 230, .88);
}

.left-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image: var(--star-pattern);
}

.decorative-circle {
    position: absolute;
    z-index: -1;
    border: 1px solid rgba(255, 226, 180, .18);
    border-radius: 50%;
}

.circle-1 {
    top: -120px;
    right: -120px;
    width: 320px;
    height: 320px;
    box-shadow: 0 0 0 40px rgba(255, 255, 255, .02);
}

.circle-2 {
    bottom: -80px;
    left: -80px;
    width: 220px;
    height: 220px;
}

.welcome-content {
    position: relative;
    width: 100%;
    max-width: 380px;
    text-align: center;
}

.mystical-icon {
    width: clamp(96px, 12vw, 136px);
    height: clamp(96px, 12vw, 136px);
    margin: 0 auto 26px;
    padding: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .92);
    box-shadow: 0 0 0 10px rgba(255, 255, 255, .08), 0 20px 40px -16px rgba(0, 0, 0, .5);
    animation: authSpin 70s linear infinite;
}

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

.welcome-content h1 {
    color: #fff;
    font-size: clamp(34px, 4vw, 46px);
    font-weight: 500;
    line-height: 1.1;
}

.left-panel .divider-line {
    background: linear-gradient(90deg, transparent, rgba(255, 226, 180, .75));
}

.left-panel .divider-line:last-child {
    background: linear-gradient(90deg, rgba(255, 226, 180, .75), transparent);
}

.left-panel .divider-diamond {
    color: #ffd9a0;
}

.welcome-content p {
    font-size: 16px;
    line-height: 1.6;
}

.welcome-content p:first-of-type {
    color: #fff;
    font-family: var(--font-display);
    font-size: 21px;
    font-style: italic;
}

.benefits-list {
    display: grid;
    gap: 12px;
    margin-top: 28px;
    padding: 20px;
    border: 1px solid rgba(255, 226, 180, .18);
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, .06);
    text-align: left;
}

.benefit-item {
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff4e6;
    font-size: 15px;
}

.benefit-icon {
    display: grid;
    place-items: center;
    width: 24px;
    height: 24px;
    flex: 0 0 24px;
    border-radius: 50%;
    background: rgba(255, 217, 160, .2);
    color: #ffd9a0;
    font-size: 12px;
    font-weight: 700;
}

/* ---------- Form panel ---------- */
.right-panel {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: clamp(32px, 5vw, 64px) clamp(24px, 5vw, 60px);
}

.login-header,
.registration-header {
    margin-bottom: 28px;
}

.login-header h2,
.registration-header h2 {
    margin-bottom: 6px;
    color: var(--ink);
    font-size: clamp(32px, 3.6vw, 42px);
    font-weight: 500;
}

.login-header p,
.registration-header p {
    color: var(--muted);
    font-size: 15px;
}

.messages {
    margin-bottom: 18px;
}

.right-panel form {
    display: grid;
    gap: 18px;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.form-group {
    position: relative;
}

.input-wrapper {
    position: relative;
    display: block;
}

.input-icon {
    position: absolute;
    top: 50%;
    left: 16px;
    z-index: 1;
    display: inline-flex;
    color: var(--gold-600);
    transform: translateY(-50%);
    pointer-events: none;
}

.input-icon .ico {
    width: 18px;
    height: 18px;
}

.input-wrapper input,
.input-wrapper select,
.right-panel .form-group input[type="email"],
.right-panel .form-group input[type="password"],
.right-panel .form-group input[type="text"] {
    width: 100%;
    min-height: 52px;
    padding: 13px 16px;
    border: 1.5px solid var(--line-strong);
    border-radius: var(--radius-sm);
    background-color: var(--bg);
    color: var(--ink);
    font-family: var(--font-body);
    font-size: 15px;
    transition: border-color var(--t-fast) ease, box-shadow var(--t-fast) ease, background-color var(--t-fast) ease;
}

.right-panel .form-group .input-wrapper input,
.right-panel .form-group .input-wrapper select {
    padding-left: 46px;
}

.right-panel .form-group .input-wrapper input#password,
.right-panel .form-group .input-wrapper input#confirmPassword,
.right-panel .form-group .input-wrapper input[type="password"] {
    padding-right: 52px;
}

.input-wrapper input:focus,
.input-wrapper select:focus,
.right-panel .form-group input:focus {
    outline: none;
    border-color: var(--gold);
    background-color: #fff;
    box-shadow: var(--ring);
}

.input-wrapper.error input,
.input-wrapper.error select,
.iti.error input {
    border-color: var(--danger) !important;
    background-color: #fffafa !important;
}

/* Password eye — the JS swaps the emoji text, CSS draws a clean icon
   and flips it when the field is revealed (type="text"). */
.password-toggle {
    position: absolute;
    top: 50%;
    right: 8px;
    z-index: 2;
    display: grid;
    place-items: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    color: transparent;
    font-size: 0;
    cursor: pointer;
    transform: translateY(-50%);
    transition: background-color var(--t-fast) ease;
}

.password-toggle:hover {
    background: var(--gold-tint);
}

.password-toggle::before {
    content: '';
    width: 19px;
    height: 19px;
    background: var(--muted);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M2 12s3.5-7 10-7 10 7 10 7-3.5 7-10 7S2 12 2 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E") center / contain no-repeat;
}

.input-wrapper input[type="text"] ~ .password-toggle::before {
    background: var(--brand);
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.9 17.9A10 10 0 0 1 12 19C5.5 19 2 12 2 12a18 18 0 0 1 5.1-5.9M9.9 5.2A9 9 0 0 1 12 5c6.5 0 10 7 10 7a18 18 0 0 1-2.2 3.2M14.1 14.1a3 3 0 1 1-4.2-4.2M2 2l20 20'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='1.9' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M17.9 17.9A10 10 0 0 1 12 19C5.5 19 2 12 2 12a18 18 0 0 1 5.1-5.9M9.9 5.2A9 9 0 0 1 12 5c6.5 0 10 7 10 7a18 18 0 0 1-2.2 3.2M14.1 14.1a3 3 0 1 1-4.2-4.2M2 2l20 20'/%3E%3C/svg%3E");
}

/* server-side errors */
.error-message,
.error,
.errorlist {
    margin-top: 6px;
    color: var(--danger);
    font-size: 13px;
}

.error-message span {
    display: block;
}

.error .errorlist,
.error ul {
    margin: 0;
    list-style: none;
}

/* options row */
.form-options {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.remember-me,
.terms-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: var(--text);
    font-size: 14px;
    line-height: 1.5;
    cursor: pointer;
}

.remember-me input,
.terms-checkbox input {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    margin-top: 1px;
    cursor: pointer;
}

.terms-checkbox a,
.forgot-password {
    color: var(--brand);
    font-weight: 500;
}

.forgot-password {
    font-size: 14px;
}

.forgot-password:hover,
.terms-checkbox a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* primary button */
.login-btn,
.register-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 54px;
    margin-top: 4px;
    padding: 14px 24px;
    border: 0;
    border-radius: var(--radius-pill);
    background: var(--grad-brand);
    color: #fff;
    font-family: var(--font-body);
    font-size: 16px;
    font-weight: 500;
    letter-spacing: .04em;
    cursor: pointer;
    box-shadow: var(--shadow-brand);
    transition: transform var(--t) var(--ease), box-shadow var(--t) var(--ease), background var(--t-fast) ease;
}

.login-btn span:last-child,
.register-btn span:last-child {
    transition: transform var(--t) var(--ease);
}

.login-btn:hover,
.register-btn:hover {
    background: var(--grad-brand-hover);
    transform: translateY(-2px);
}

.login-btn:hover span:last-child,
.register-btn:hover span:last-child {
    transform: translateX(4px);
}

.login-btn:disabled,
.register-btn:disabled,
.login-btn.loading,
.register-btn.loading {
    opacity: .75;
    cursor: not-allowed;
    transform: none;
}

.loader-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    margin-right: 8px;
    border: 2px solid rgba(255, 255, 255, .35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: authSpin .7s linear infinite;
}

.signup-link,
.signin-link {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: 15px;
    text-align: center;
}

.signup-link a,
.signin-link a {
    color: var(--brand);
    font-weight: 600;
}

.signup-link a:hover,
.signin-link a:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    body {
        align-items: flex-start;
    }

    .login-container,
    .registration-container {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .left-panel {
        padding: 34px 24px 30px;
    }

    .mystical-icon {
        width: 76px;
        height: 76px;
        margin-bottom: 16px;
    }

    .welcome-content h1 {
        font-size: 32px;
    }

    .left-panel .divider {
        margin: 12px 0;
    }

    .welcome-content p:not(:first-of-type) {
        display: none;
    }

    .benefits-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        margin-top: 18px;
        padding: 14px;
    }

    .benefit-item {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    body {
        padding: 0;
    }

    .login-container,
    .registration-container {
        min-height: 100vh;
        border-radius: 0;
    }

    .form-row,
    .benefits-list {
        grid-template-columns: 1fr;
    }

    .benefits-list {
        display: none;
    }

    .right-panel {
        padding: 28px 20px 36px;
    }
}
