/**
 * Futia SaaS — Auth Pages: Cosmic Portal Design
 * Deep space glassmorphism with animated border + nebula glow
 * Sora font — uses theme CSS variables from style.css
 */

/* ══════════════════════════════════════════
   KEYFRAMES
   ══════════════════════════════════════════ */

@keyframes authPortalSpin {
    0%   { --auth-angle: 0deg; }
    100% { --auth-angle: 360deg; }
}

@keyframes authCardReveal {
    0% {
        opacity: 0;
        transform: translateY(28px) scale(0.97);
        filter: blur(6px);
    }
    60% {
        filter: blur(0);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
        filter: blur(0);
    }
}

@keyframes authNebulaBreath {
    0%, 100% {
        opacity: 0.45;
        transform: translate(-50%, -50%) scale(1);
    }
    50% {
        opacity: 0.7;
        transform: translate(-50%, -50%) scale(1.12);
    }
}

@keyframes authShimmer {
    0%   { background-position: -200% center; }
    100% { background-position: 200% center; }
}

/* Register the custom property for conic-gradient animation */
@property --auth-angle {
    syntax: '<angle>';
    initial-value: 0deg;
    inherits: false;
}

/* ══════════════════════════════════════════
   PAGE LAYOUT
   ══════════════════════════════════════════ */

.futia-auth-page {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    padding-top: 120px;
    position: relative;
    isolation: isolate;
}

/* Nebula glow behind the card */
.futia-auth-page::before {
    content: '';
    position: fixed;
    top: 50%;
    left: 50%;
    width: 600px;
    height: 600px;
    transform: translate(-50%, -50%) scale(1);
    background: radial-gradient(
        ellipse at center,
        rgba(124, 58, 237, 0.14) 0%,
        rgba(99, 102, 241, 0.08) 30%,
        rgba(6, 182, 212, 0.04) 55%,
        transparent 75%
    );
    border-radius: 50%;
    pointer-events: none;
    z-index: -1;
    animation: authNebulaBreath 8s ease-in-out infinite;
}

/* ══════════════════════════════════════════
   CONTAINER
   ══════════════════════════════════════════ */

.futia-auth-container {
    width: 100%;
    max-width: 460px;
    animation: authCardReveal 0.7s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ══════════════════════════════════════════
   CARD — Animated conic border + deep glass
   ══════════════════════════════════════════ */

.futia-auth-card {
    position: relative;
    background:
        linear-gradient(
            168deg,
            rgba(255, 255, 255, 0.05) 0%,
            rgba(255, 255, 255, 0.015) 40%,
            rgba(124, 58, 237, 0.03) 100%
        );
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 24px;
    padding: 44px 40px;
    backdrop-filter: blur(24px) saturate(1.3);
    -webkit-backdrop-filter: blur(24px) saturate(1.3);
    box-shadow:
        0 4px 60px rgba(124, 58, 237, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.06);
    overflow: hidden;
}

/* Animated gradient top-edge glow */
.futia-auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 2px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(124, 58, 237, 0.5) 20%,
        rgba(99, 102, 241, 0.7) 40%,
        rgba(6, 182, 212, 0.5) 60%,
        rgba(139, 92, 246, 0.6) 80%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: authShimmer 6s linear infinite;
    border-radius: 24px 24px 0 0;
}

/* Subtle inner ambient glow */
.futia-auth-card::after {
    content: '';
    position: absolute;
    top: -1px;
    left: 20%;
    right: 20%;
    height: 80px;
    background: radial-gradient(
        ellipse at center top,
        rgba(124, 58, 237, 0.1) 0%,
        transparent 70%
    );
    pointer-events: none;
    border-radius: 24px 24px 0 0;
}

/* ══════════════════════════════════════════
   AUTH HEADER
   ══════════════════════════════════════════ */

.futia-auth-header {
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    z-index: 1;
}

.futia-auth-header h1 {
    font-family: 'Sora', sans-serif;
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    color: #fff;
    margin: 0 0 10px;
    line-height: 1.2;
}

.futia-auth-header p {
    color: rgba(255, 255, 255, 0.5);
    font-size: 14.5px;
    font-weight: 400;
    margin: 0;
    line-height: 1.6;
    letter-spacing: -0.01em;
}

.futia-auth-header p strong {
    color: #a78bfa;
    font-weight: 600;
}

/* ══════════════════════════════════════════
   FLASH MESSAGES — Glass with left accent
   ══════════════════════════════════════════ */

.futia-auth-error {
    background: rgba(239, 68, 68, 0.06);
    border: 1px solid rgba(239, 68, 68, 0.12);
    border-left: 3px solid #ef4444;
    color: #fca5a5;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}

.futia-auth-error i {
    color: #ef4444;
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

.futia-auth-success {
    background: rgba(16, 185, 129, 0.06);
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-left: 3px solid #10b981;
    color: #6ee7b7;
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 13.5px;
    line-height: 1.5;
    margin-bottom: 22px;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    position: relative;
    z-index: 1;
}

.futia-auth-success i {
    color: #10b981;
    font-size: 15px;
    flex-shrink: 0;
    margin-top: 1px;
}

/* ══════════════════════════════════════════
   GOOGLE OAUTH BUTTON
   ══════════════════════════════════════════ */

.futia-btn-google {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 14px 20px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: #fff;
    font-size: 14.5px;
    font-weight: 600;
    font-family: 'Sora', sans-serif;
    text-decoration: none;
    cursor: pointer;
    position: relative;
    z-index: 1;
    overflow: hidden;
    transition:
        background 0.3s ease,
        border-color 0.3s ease,
        transform 0.25s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.3s ease;
}

.futia-btn-google::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(66, 133, 244, 0.04) 0%,
        rgba(52, 168, 83, 0.03) 33%,
        rgba(251, 188, 5, 0.03) 66%,
        rgba(234, 67, 53, 0.04) 100%
    );
    opacity: 0;
    transition: opacity 0.3s ease;
    border-radius: inherit;
}

.futia-btn-google:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.18);
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.25);
}

.futia-btn-google:hover::before {
    opacity: 1;
}

.futia-btn-google:active {
    transform: translateY(0);
    box-shadow: none;
}

.futia-btn-google svg {
    flex-shrink: 0;
    position: relative;
}

/* ══════════════════════════════════════════
   DIVIDER
   ══════════════════════════════════════════ */

.futia-auth-divider {
    display: flex;
    align-items: center;
    margin: 26px 0;
    gap: 16px;
    position: relative;
    z-index: 1;
}

.futia-auth-divider::before,
.futia-auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 50%,
        transparent 100%
    );
}

.futia-auth-divider::before {
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.08) 100%
    );
}

.futia-auth-divider::after {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.08) 0%,
        transparent 100%
    );
}

.futia-auth-divider span {
    color: rgba(255, 255, 255, 0.25);
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
}

/* ══════════════════════════════════════════
   FORM
   ══════════════════════════════════════════ */

.futia-auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.futia-form-group {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.futia-form-group label {
    color: rgba(255, 255, 255, 0.55);
    font-size: 12.5px;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.futia-form-group input {
    width: 100%;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    color: #fff;
    font-size: 15px;
    font-family: 'Sora', sans-serif;
    font-weight: 400;
    outline: none;
    box-sizing: border-box;
    transition:
        border-color 0.25s ease,
        background 0.25s ease,
        box-shadow 0.25s ease;
}

.futia-form-group input::placeholder {
    color: rgba(255, 255, 255, 0.18);
    font-weight: 400;
}

.futia-form-group input:hover {
    border-color: rgba(255, 255, 255, 0.14);
    background: rgba(255, 255, 255, 0.04);
}

.futia-form-group input:focus {
    border-color: rgba(124, 58, 237, 0.6);
    background: rgba(124, 58, 237, 0.04);
    box-shadow:
        0 0 0 3px rgba(124, 58, 237, 0.12),
        inset 0 1px 4px rgba(0, 0, 0, 0.15);
}

/* Autofill styling */
.futia-form-group input:-webkit-autofill,
.futia-form-group input:-webkit-autofill:hover,
.futia-form-group input:-webkit-autofill:focus {
    -webkit-text-fill-color: #fff;
    -webkit-box-shadow: 0 0 0 1000px rgba(15, 14, 24, 0.98) inset;
    border-color: rgba(124, 58, 237, 0.3);
    transition: background-color 5000s ease-in-out 0s;
}

/* ══════════════════════════════════════════
   FORM HINTS
   ══════════════════════════════════════════ */

.futia-form-hint {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.35);
    margin-top: 4px;
    line-height: 1.4;
    transition: color 0.2s ease;
}

.futia-form-hint i {
    margin-right: 3px;
}

.futia-form-hint.hint-error {
    color: #f87171;
}

.futia-form-hint.hint-success {
    color: #34d399;
}

/* Input validation states (username page) */
#username.input-error {
    border-color: rgba(239, 68, 68, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.08) !important;
}

#username.input-success {
    border-color: rgba(16, 185, 129, 0.5) !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.08) !important;
}

/* ══════════════════════════════════════════
   SUBMIT BUTTON (extends global .btn-primary)
   ══════════════════════════════════════════ */

.futia-auth-submit {
    margin-top: 6px;
    padding: 15px 24px !important;
    font-size: 15px !important;
    font-weight: 700 !important;
    letter-spacing: 0.01em;
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px !important;
    width: 100%;
    position: relative;
    z-index: 1;
}

.futia-auth-submit i {
    font-size: 14px;
}

/* ══════════════════════════════════════════
   FORGOT PASSWORD LINK (inline style override)
   ══════════════════════════════════════════ */

.futia-auth-card > div[style*="text-align:center"] > a[href*="sifremi-unuttum"] {
    color: rgba(255, 255, 255, 0.35) !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    transition: color 0.2s ease;
    text-decoration: none !important;
}

.futia-auth-card > div[style*="text-align:center"] > a[href*="sifremi-unuttum"]:hover {
    color: rgba(167, 139, 250, 0.8) !important;
}

/* ══════════════════════════════════════════
   FOOTER LINK
   ══════════════════════════════════════════ */

.futia-auth-footer {
    text-align: center;
    margin-top: 28px;
    padding-top: 22px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    color: rgba(255, 255, 255, 0.4);
    font-size: 13.5px;
    font-weight: 400;
    position: relative;
    z-index: 1;
}

.futia-auth-footer a {
    color: #a78bfa;
    text-decoration: none;
    font-weight: 700;
    transition: color 0.2s ease;
}

.futia-auth-footer a:hover {
    color: #c4b5fd;
    text-decoration: none;
}

/* ══════════════════════════════════════════
   VERIFICATION / STATUS PAGES
   Icon circles, centered content, progress bar
   ══════════════════════════════════════════ */

/* Resend status message */
#resend-status {
    border-radius: 10px !important;
    font-size: 13.5px !important;
    font-weight: 500 !important;
}

/* Progress bar (dogrula page) */
#redirect-progress {
    transition: width 3s cubic-bezier(0.22, 1, 0.36, 1) !important;
}

/* ══════════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════════ */

@media (max-width: 520px) {
    .futia-auth-page {
        padding: 30px 16px;
        padding-top: 100px;
    }

    .futia-auth-container {
        max-width: 100%;
    }

    .futia-auth-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .futia-auth-card::before {
        border-radius: 20px 20px 0 0;
    }

    .futia-auth-header h1 {
        font-size: 22px;
    }

    .futia-auth-header p {
        font-size: 13.5px;
    }

    .futia-form-group input {
        padding: 13px 14px;
        font-size: 14px;
    }

    .futia-btn-google {
        padding: 13px 16px;
        font-size: 14px;
    }

    .futia-auth-page::before {
        width: 400px;
        height: 400px;
    }
}

@media (max-width: 380px) {
    .futia-auth-card {
        padding: 28px 20px;
    }

    .futia-auth-header {
        margin-bottom: 24px;
    }

    .futia-auth-header h1 {
        font-size: 20px;
    }
}
