@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800;900&display=swap');

:root {
    --bg-main: #060913;
    --card-bg: rgba(10, 15, 30, 0.86);
    
    --text-primary: #f8fafc;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --text-placeholder: #475569;

    --btn-gradient: linear-gradient(135deg, #a855f7 0%, #ec4899 50%, #f43f5e 100%);
    --text-gradient: linear-gradient(90deg, #f97316 0%, #ec4899 45%, #a855f7 85%, #38bdf8 100%);
    
    --border-subtle: rgba(255, 255, 255, 0.08);
    --border-focus: rgba(168, 85, 247, 0.85);

    --shadow-deep: 0 20px 60px rgba(0, 0, 0, 0.7);
    --btn-shadow: 0 8px 22px rgba(236, 72, 153, 0.32);
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    min-height: 100%;
    -webkit-text-size-adjust: 100%;
}

/* SINGLE SMOOTH UNIFIED BACKGROUND */
body {
    min-height: 100dvh;
    width: 100vw;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px 16px;
    overflow-x: hidden;
    overflow-y: auto; /* Natural scrolling jab screen height kam ho */
    color: var(--text-primary);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    background: 
        radial-gradient(circle at 50% 25%, rgba(168, 85, 247, 0.16) 0%, rgba(236, 72, 153, 0.06) 40%, transparent 70%),
        #060913;
    -webkit-font-smoothing: antialiased;
}

a {
    text-decoration: none;
    color: inherit;
    -webkit-tap-highlight-color: transparent;
}

button, input {
    font: inherit;
    outline: none;
}

button {
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

/* AUTH SHELL */
.auth-shell {
    width: 100%;
    max-width: 390px;
    position: relative;
    z-index: 2;
    margin: auto;
}

/* GLASS PANEL */
.auth-panel {
    position: relative;
    width: 100%;
    padding: 24px 24px 22px;
    border-radius: 24px;
    background: var(--card-bg);
    border: 1px solid var(--border-subtle);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    box-shadow: var(--shadow-deep), 0 0 0 1px rgba(255, 255, 255, 0.03);
    animation: panelFade 0.35s ease-out forwards;
}

@keyframes panelFade {
    from { opacity: 0; transform: translateY(10px) scale(0.99); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* HEADER */
.auth-header {
    text-align: center;
    margin-bottom: 16px;
}

.panel-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 8px;
}

.panel-brand img {
    width: auto;
    height: 50px;
    object-fit: contain;
    filter: drop-shadow(0 0 16px rgba(236, 72, 153, 0.45));
}

.auth-header h1 {
    font-size: 1.7rem;
    font-weight: 900;
    letter-spacing: -0.04em;
    line-height: 1.1;
    margin-bottom: 4px;
    background: var(--text-gradient);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 0.82rem;
    line-height: 1.4;
    max-width: 300px;
    margin: 0 auto;
}

/* ALERT */
.alert {
    margin-bottom: 14px;
    padding: 10px 12px;
    border-radius: 12px;
    border: 1px solid rgba(248, 113, 113, 0.25);
    background: rgba(239, 68, 68, 0.12);
    color: #fca5a5;
    font-size: 0.82rem;
    line-height: 1.35;
}

.alert p {
    margin: 0;
}

/* GOOGLE LOGIN */
.google-login-wrap {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 14px;
    overflow: hidden;
    border-radius: 25px;
}

.google-login-wrap .g_id_signin {
    width: 100% !important;
    display: flex !important;
    justify-content: center !important;
}

.google-login-wrap iframe {
    margin: 0 auto !important;
    max-width: 100% !important;
}

/* DIVIDER */
.divider-row {
    display: flex;
    align-items: center;
    text-align: center;
    margin-bottom: 14px;
    color: var(--text-dim);
    font-size: 0.74rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.divider-row::before,
.divider-row::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.divider-row span {
    padding: 0 10px;
}

/* FORM */
form {
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.field {
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: #e2e8f0;
    font-size: 0.82rem;
    font-weight: 600;
}

.password-shell {
    position: relative;
    width: 100%;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    height: 44px;
    border-radius: 12px;
    border: 1px solid var(--border-subtle);
    background: #080d1a;
    color: #ffffff;
    padding: 0 14px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.password-shell input {
    padding-right: 44px;
}

input::placeholder {
    color: var(--text-placeholder);
    font-size: 13px;
}

input:hover {
    border-color: rgba(168, 85, 247, 0.35);
}

input:focus {
    border-color: var(--border-focus);
    background: #090e1f;
    box-shadow: 0 0 0 3px rgba(168, 85, 247, 0.15);
}

/* TOGGLE EYE */
.password-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-dim);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: color 0.15s ease, background 0.15s ease;
}

.password-toggle:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #cbd5e1;
}

.password-toggle .icon {
    width: 17px;
    height: 17px;
}

.password-toggle .icon-eye-off { display: none; }
.password-toggle.is-visible .icon-eye { display: none; }
.password-toggle.is-visible .icon-eye-off { display: block; }

/* ACTIONS */
.login-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    margin-top: -1px;
}

.remember-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
}

.remember-wrap input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.remember-box {
    width: 15px;
    height: 15px;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.03);
    display: grid;
    place-items: center;
    transition: all 0.15s ease;
}

.remember-wrap:hover .remember-box {
    border-color: rgba(168, 85, 247, 0.5);
}

.remember-wrap input:checked + .remember-box {
    background: var(--btn-gradient);
    border-color: transparent;
}

.remember-wrap input:checked + .remember-box::after {
    content: "";
    width: 3.5px;
    height: 6.5px;
    border: solid #ffffff;
    border-width: 0 1.8px 1.8px 0;
    transform: rotate(45deg);
    margin-bottom: 1.5px;
}

.forgot-link {
    color: #c084fc;
    font-weight: 600;
    transition: color 0.15s ease;
}

.forgot-link:hover {
    color: #f472b6;
}

/* BUTTON */
.auth-button {
    position: relative;
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 12px;
    background: var(--btn-gradient);
    color: #ffffff;
    font-size: 0.92rem;
    font-weight: 800;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    box-shadow: var(--btn-shadow);
    transition: transform 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
    margin-top: 2px;
}

.auth-button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(236, 72, 153, 0.4);
}

.auth-button:active {
    transform: translateY(0);
}

.button-loader {
    width: 15px;
    height: 15px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top: 2px solid #ffffff;
    border-radius: 50%;
    display: none;
    animation: spin 0.8s linear infinite;
}

.auth-button.is-loading {
    opacity: 0.9;
    pointer-events: none;
}

.auth-button.is-loading .button-loader {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.auth-link {
    margin-top: 16px;
    text-align: center;
    color: var(--text-dim);
    font-size: 0.82rem;
}

.auth-link a {
    color: #c084fc;
    font-weight: 800;
    transition: color 0.15s ease;
}

.auth-link a:hover {
    color: #f472b6;
}

input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
    -webkit-text-fill-color: #ffffff;
    -webkit-box-shadow: 0 0 0px 1000px #080d1a inset;
    transition: background-color 5000s ease-in-out 0s;
}

/* MOBILE ADAPTATION */
@media (max-width: 480px) {
    body {
        padding: 16px 12px;
    }

    .auth-panel {
        padding: 22px 18px 20px;
        border-radius: 20px;
    }

    .panel-brand img {
        height: 44px;
    }

    .auth-header h1 {
        font-size: 1.55rem;
    }

    input[type="text"],
    input[type="password"],
    .auth-button {
        height: 44px;
    }
}