/* =========================================
   SkillForgeX — Login Page
   Uses style.css variables (no own :root)
   Load AFTER style.css
   ========================================= */

/* ============ RESET ============ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    text-decoration: none;
    list-style-type: none;
    border: none;
    outline: none;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Segoe UI", Roboto, sans-serif;
    -webkit-tap-highlight-color: transparent;
}

html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    min-height: 100dvh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    position: relative;
    background: var(--bg-color);
    color: var(--text-main);
    transition: background 0.8s ease, color 0.5s ease;
}

/* ============ ANIMATED GRADIENT BACKGROUND ============ */
.gradient-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
    transition: background 0.8s ease;
}

.gradient-bg svg {
    display: none;
}

.gradient-bg .gradients-container {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    filter: url(#goo) blur(80px);
}

.gradient-bg .g1,
.gradient-bg .g2,
.gradient-bg .g3,
.gradient-bg .g4 {
    position: absolute;
    width: 55vw;
    height: 55vw;
    max-width: 800px;
    max-height: 800px;
    border-radius: 50%;
    opacity: 0.75;
    transform-origin: center center;
    will-change: transform;
    transition: opacity 0.6s ease;
}

.gradient-bg .g1 {
    background: radial-gradient(circle at center, var(--blob-1) 0%, transparent 65%);
    top: -15%;
    left: -10%;
    animation: float1 18s ease-in-out infinite alternate;
}

.gradient-bg .g2 {
    background: radial-gradient(circle at center, var(--blob-2) 0%, transparent 65%);
    bottom: -15%;
    right: -10%;
    animation: float2 22s ease-in-out infinite alternate;
}

.gradient-bg .g3 {
    background: radial-gradient(circle at center, var(--blob-3) 0%, transparent 65%);
    top: 25%;
    left: 35%;
    animation: float3 20s ease-in-out infinite alternate;
}

.gradient-bg .g4 {
    background: radial-gradient(circle at center, #bf5af2 0%, transparent 65%);
    bottom: 5%;
    left: 5%;
    animation: float4 24s ease-in-out infinite alternate;
}

@keyframes float1 {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    50%  { transform: translate(12%, 15%) scale(1.15) rotate(20deg); }
    100% { transform: translate(-5%, 8%) scale(0.95) rotate(-10deg); }
}

@keyframes float2 {
    0%   { transform: translate(0, 0) scale(1) rotate(0deg); }
    50%  { transform: translate(-15%, -10%) scale(1.1) rotate(-25deg); }
    100% { transform: translate(8%, -5%) scale(1.05) rotate(15deg); }
}

@keyframes float3 {
    0%   { transform: translate(-50%, -50%) scale(1); }
    50%  { transform: translate(-40%, -60%) scale(1.2); }
    100% { transform: translate(-60%, -45%) scale(0.9); }
}

@keyframes float4 {
    0%   { transform: translate(0, 0) scale(1); }
    50%  { transform: translate(20%, -15%) scale(1.15); }
    100% { transform: translate(-10%, 10%) scale(0.95); }
}

/* ============ LOGIN CARD ============ */
.content {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 420px;
    max-height: calc(100dvh - 40px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    padding: 36px 40px;
    border-radius: 24px;
    box-shadow:
        0 20px 60px -15px var(--glass-shadow),
        0 8px 25px -10px rgba(0, 0, 0, 0.12),
        inset 0 2px 3px -1px var(--glass-highlight),
        inset 0 -2px 4px -1px rgba(255, 255, 255, 0.2),
        inset 0 0 0 1px var(--glass-border);
    animation: cardIn 0.9s cubic-bezier(0.34, 1.2, 0.64, 1) both;
    transition: background 0.5s ease, border-color 0.5s ease, box-shadow 0.5s ease;
}

/* thin scrollbar for the card */
.content::-webkit-scrollbar { width: 6px; }
.content::-webkit-scrollbar-track { background: transparent; }
.content::-webkit-scrollbar-thumb {
    background: var(--card-border);
    border-radius: 99px;
}

.content::before {
    content: '';
    position: absolute;
    top: 0;
    left: 10%;
    right: 10%;
    height: 1.5px;
    background: linear-gradient(90deg, transparent, var(--glass-highlight), transparent);
    border-radius: 50%;
    pointer-events: none;
}

.content::after {
    content: '';
    position: absolute;
    inset: -2px;
    border-radius: 26px;
    background: linear-gradient(135deg,
        color-mix(in srgb, var(--blob-1) 25%, transparent),
        color-mix(in srgb, var(--blob-2) 25%, transparent),
        color-mix(in srgb, var(--blob-3) 25%, transparent));
    z-index: -1;
    filter: blur(20px);
    opacity: 0.6;
    animation: glowPulse 6s ease-in-out infinite;
}

@keyframes glowPulse {
    0%, 100% { opacity: 0.4; }
    50%      { opacity: 0.75; }
}

@keyframes cardIn {
    from { opacity: 0; transform: translateY(30px) scale(0.94); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

.content h2 {
    font-size: 36px;
    font-weight: 700;
    text-align: center;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin-bottom: 4px;
    transition: color 0.4s ease;
}

.content h2 span {
    background: linear-gradient(135deg, #ff2a5f, #007aff, #ff9500);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ============ BRAND MINI (top logo) ============ */
.brand-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 18px;
}

.brand-mini-mark {
    position: relative;
    width: 34px;
    height: 34px;
    display: block;
    flex-shrink: 0;
}

.brand-mini-mark img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-mini-mark .logo-white { display: none; }

html[data-theme="dark"] .brand-mini-mark .logo-black { display: none; }
html[data-theme="dark"] .brand-mini-mark .logo-white { display: block; }

.brand-mini-text {
    font-size: 18px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--text-main);
    transition: color 0.4s ease;
}

/* ============ INPUT FIELDS ============ */
.content .input-box {
    position: relative;
    width: 100%;
    height: 54px;
    margin: 26px 0;
}

.content .input-box input {
    background: var(--card-bg);
    width: 100%;
    height: 100%;
    border: 2px solid var(--card-border);
    border-radius: 30px;
    padding: 20px 48px 20px 22px;
    font-size: 16px;
    color: var(--text-main);
    font-weight: 500;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        inset 0 1px 2px var(--glass-highlight),
        0 2px 8px rgba(0, 0, 0, 0.04);
    transition: border-color 0.3s ease, box-shadow 0.3s ease,
                background 0.3s ease, color 0.3s ease;
}

.content .input-box input:focus {
    border-color: rgba(0, 122, 255, 0.55);
    box-shadow:
        inset 0 1px 2px var(--glass-highlight),
        0 0 0 4px rgba(0, 122, 255, 0.12),
        0 4px 14px rgba(0, 122, 255, 0.15);
}

input::placeholder {
    color: var(--text-soft);
    font-size: 16px;
    font-weight: 500;
}

.input-box i {
    position: absolute;
    top: 50%;
    right: 20px;
    transform: translateY(-50%);
    font-size: 18px;
    color: var(--text-soft);
    transition: color 0.25s ease;
}

.input-box input:focus ~ i {
    color: var(--text-main);
}

.input-box i.toggle-password {
    cursor: pointer;
    user-select: none;
}

/* ============ REMEMBER / FORGOT ============ */
.content .remember {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: -12px 0 20px;
    font-size: 14px;
    color: var(--text-main);
}

.remember label {
    display: flex;
    align-items: center;
    cursor: pointer;
    white-space: nowrap;
    font-weight: 500;
}

.remember label input {
    accent-color: #007aff;
    margin-right: 8px;
    flex-shrink: 0;
    width: 15px;
    height: 15px;
}

.remember a {
    color: var(--text-main);
    font-weight: 600;
    white-space: nowrap;
    transition: color 0.25s ease;
}

.remember a:hover {
    color: #007aff;
    text-decoration: underline;
}

/* ============ MAIN BUTTON ============ */
.btnn {
    display: inline-block;
    background: linear-gradient(135deg, #ff2a5f 0%, #ff9500 100%);
    color: #fff;
    width: 100%;
    border-radius: 30px;
    font-size: 16px;
    height: 50px;
    font-weight: 700;
    letter-spacing: 0.3px;
    text-align: center;
    cursor: pointer;
    margin-top: 4px;
    margin-bottom: 28px;
    box-shadow:
        0 8px 22px -6px rgba(255, 42, 95, 0.5),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.25s ease;
}

.btnn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 14px 30px -8px rgba(255, 42, 95, 0.65),
        inset 0 1px 1px rgba(255, 255, 255, 0.4);
}

.btnn:active {
    transform: translateY(0) scale(0.98);
    opacity: 0.95;
}

/* ============ DIVIDER ("or") ============ */
.divider {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: -12px 0 18px;
    color: var(--text-soft);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    user-select: none;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    border-radius: 99px;
    background: linear-gradient(90deg,
        transparent,
        var(--card-border) 20%,
        var(--card-border) 80%,
        transparent);
}

/* ============ GOOGLE BUTTON ============ */
.google-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    height: 50px;
    border-radius: 30px;
    background: var(--card-bg);
    border: 2px solid var(--card-border);
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 0.2px;
    font-family: inherit;
    cursor: pointer;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.05),
        inset 0 1px 2px var(--glass-highlight);
    transition: transform 0.25s ease, box-shadow 0.25s ease,
                background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

html[data-theme="light"] .google-btn {
    background: #ffffff;
}

.google-btn:hover {
    transform: translateY(-2px);
    box-shadow:
        0 8px 20px rgba(0, 0, 0, 0.10),
        inset 0 1px 2px var(--glass-highlight);
}

.google-btn:active {
    transform: translateY(0) scale(0.98);
}

.google-btn:focus-visible {
    border-color: rgba(0, 122, 255, 0.55);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.15);
}

.google-logo {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    display: block;
}

/* ============ SOCIAL ROW (legacy) ============ */
.button {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 14px;
    text-align: center;
}

.button a {
    color: var(--text-main);
    font-size: 15px;
    font-weight: 600;
    padding: 10px 18px;
    border-radius: 30px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    transition: transform 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.button a i {
    font-size: 18px;
    margin-right: 8px;
    vertical-align: middle;
}

.button a:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.1);
}

/* ============ MISC ============ */
input::-ms-reveal,
input::-ms-clear {
    display: none;
}

input::-webkit-credentials-auto-fill-button,
input::-webkit-clear-button,
input::-webkit-inner-spin-button,
input::-webkit-contacts-auto-fill-button {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none;
    height: 0;
    width: 0;
    margin: 0;
    padding: 0;
}

/* ============ AUTH TABS (override .button) ============ */
#authTabs {
    margin-bottom: 6px;
}

#authTabs a {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1px solid var(--card-border);
}

#authTabs a i {
    color: var(--text-main);
}

#authTabs a.active {
    background: linear-gradient(135deg, #ff2a5f, #ff9500) !important;
    color: #fff !important;
    border-color: transparent !important;
    box-shadow: 0 8px 22px -6px rgba(255, 42, 95, .55);
}

#authTabs a.active i {
    color: #fff !important;
}

/* ============ FORM SHOW / HIDE ============ */
.auth-form {
    display: none !important;
}

.auth-form.active {
    display: flex !important;
    flex-direction: column;
    animation: cardIn .5s cubic-bezier(.34, 1.2, .64, 1) both;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 480px) {
    body { padding: 16px; }

    .content {
        padding: 30px 24px;
        border-radius: 22px;
        max-width: 100%;
        max-height: calc(100dvh - 32px);
    }

    .content h2 { font-size: 28px; }

    .brand-mini { margin-bottom: 14px; }
    .brand-mini-mark { width: 30px; height: 30px; }
    .brand-mini-text { font-size: 16px; }

    .content .input-box { height: 50px; margin: 20px 0; }
    .content .input-box input,
    input::placeholder { font-size: 15px; }

    .content .remember { font-size: 13px; flex-wrap: wrap; gap: 8px; }

    .btnn {
        height: 46px;
        margin-bottom: 24px;
        font-size: 15px;
    }

    .divider { font-size: 11px; margin: -10px 0 16px; }

    .google-btn { height: 46px; font-size: 14px; }
    .google-logo { width: 18px; height: 18px; }

    .button { gap: 10px; }
    .button a { font-size: 13px; padding: 8px 14px; }
    .button a i { font-size: 16px; margin-right: 5px; }
}

@media (max-width: 360px) {
    .content { padding: 26px 18px; }
    .content h2 { font-size: 24px; }
    .divider { gap: 10px; }
    .button { flex-direction: column; gap: 10px; }
    .button a { width: 100%; }
}

@media (max-height: 560px) and (orientation: landscape) {
    body {
        align-items: flex-start;
        padding: 20px 16px;
        overflow-y: auto;
    }
    .content { margin: auto; }
}

@media (prefers-reduced-motion: reduce) {
    .gradient-bg .g1,
    .gradient-bg .g2,
    .gradient-bg .g3,
    .gradient-bg .g4,
    .content,
    .content::after {
        animation: none;
    }
}