/* Dark Empires — Auth pages (login + register) */

body.auth-page {
    font-family: 'Inter', sans-serif;
    background:
        radial-gradient(900px 500px at 10% -10%, rgba(99,102,241,0.18), transparent 60%),
        radial-gradient(800px 500px at 110% 10%, rgba(16,185,129,0.14), transparent 60%),
        linear-gradient(160deg, #f8fafc 0%, #eef2ff 100%);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2.5rem 1rem;
}

.auth-card {
    position: relative;
    background: rgba(255,255,255,0.75);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid rgba(255,255,255,0.6);
    border-radius: 1rem;
    padding: 1.75rem 1.5rem;
    box-shadow:
        0 20px 50px -20px rgba(31,41,55,0.25),
        0 8px 20px -10px rgba(99,102,241,0.18);
    width: 100%;
    max-width: 26rem;
    text-align: center;
    animation: authIn 0.55s cubic-bezier(0.16, 1, 0.3, 1) both;
}
@keyframes authIn {
    from { opacity: 0; transform: translateY(14px) scale(0.985); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* Form inputs */
.auth-form { display: flex; flex-direction: column; gap: 1.25rem; }

.field {
    position: relative;
}
.field .input-icon,
.field .toggle-password {
    position: absolute;
    z-index: 30;
    display: block;
    color: #6b7280;
    transition: color 0.2s ease;
}
.field .input-icon      { left: 1rem; top: 1rem; }
.field .toggle-password { right: 0.75rem; top: 0.95rem; cursor: pointer; }

.field input {
    width: 100%;
    background: rgba(255,255,255,0.85);
    border: 1px solid #e2e8f0;
    border-radius: 0.625rem;
    padding: 1.25rem 1rem 0.5rem 2.5rem;
    font-size: 0.875rem;
    color: #0f172a;
    outline: none;
    transition: border-color .25s ease, box-shadow .25s ease, background .25s ease;
}
.field input:hover { border-color: #cbd5e1; }
.field input:focus {
    border-color: var(--primary);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(99,102,241,0.15);
}
.field input[type="password"] { padding-right: 2.25rem; }

.field label {
    position: absolute;
    left: 2.25rem;
    top: -0.6rem;
    background: linear-gradient(180deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.95) 50%, rgba(255,255,255,0.95) 100%);
    padding: 0 0.35rem;
    font-size: 0.78rem;
    font-weight: 500;
    color: #475569;
    transition: all .25s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 10;
    pointer-events: none;
}
.field input:placeholder-shown + label {
    top: 0.875rem;
    left: 2.5rem;
    font-size: 1rem;
    color: #9ca3af;
}
.field input:focus + label {
    top: -0.6rem;
    left: 2.25rem;
    font-size: 0.78rem;
    color: var(--primary);
}
.field .toggle-password:hover { color: var(--primary); }

/* Slide-in password containers (register) */
.password-container {
    opacity: 0;
    transform: translateY(-20px);
    display: none;
    will-change: opacity, transform;
}
.password-container.visible {
    display: block;
    animation: slideInFromTop 0.7s cubic-bezier(0.33, 0, 0, 1) forwards;
}
@keyframes slideInFromTop {
    0%   { opacity: 0; transform: translateY(-20px); }
    100% { opacity: 1; transform: translateY(0); }
}

/* Buttons */
.btn-primary {
    width: 100%;
    background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
    color: #fff;
    font-weight: 600;
    padding: 0.7rem 1rem;
    border: none;
    border-radius: 0.625rem;
    cursor: pointer;
    letter-spacing: .01em;
    box-shadow: 0 8px 18px -8px rgba(79,70,229,0.55);
    transition: transform .2s ease, box-shadow .25s ease, filter .2s ease;
}
.btn-primary:hover  { transform: translateY(-1px); filter: brightness(1.05); box-shadow: 0 12px 22px -10px rgba(79,70,229,0.65); }
.btn-primary:active { transform: translateY(0); filter: brightness(0.98); }
.btn-primary:disabled { opacity: .7; cursor: not-allowed; transform: none; }

.btn-telegram {
    width: 100%;
    background: linear-gradient(135deg, #29b6f6 0%, #0088cc 100%);
    color: #fff;
    padding: 0.6rem 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.6rem;
    font-size: 0.875rem;
    font-weight: 500;
    box-shadow: 0 8px 18px -10px rgba(0,136,204,0.6);
    transition: transform .2s ease, filter .2s ease;
}
.btn-telegram:hover { transform: translateY(-1px); filter: brightness(1.05); }

#googleSignInButton {
    width: 100%;
    border-radius: 9999px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}
#googleSignInButton > div  { width: 100% !important; max-width: 100%; }

/* Misc */
.auth-links {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 1rem;
    display: flex;
    justify-content: space-between;
    gap: 0.5rem;
}
.auth-links a {
    color: #4338ca;
    font-weight: 600;
}
.auth-links a:hover { text-decoration: underline; }

.divider-text {
    display: flex;
    align-items: center;
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin: 1rem 0;
}
.divider-text::before,
.divider-text::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #e5e7eb;
}
.divider-text::before { margin-right: 0.75rem; }
.divider-text::after  { margin-left: 0.75rem; }

.error-message {
    display: none;
    background: #fef2f2;
    color: var(--danger);
    padding: 0.55rem 0.75rem;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    border-radius: 0.5rem;
    border: 1px solid #fecaca;
    text-align: left;
}
.error-message.show {
    display: block;
    animation: errIn .25s ease both;
}
@keyframes errIn {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (max-width: 480px) {
    .auth-card { padding: 1.25rem 1rem; }
}
