@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700&display=swap');

:root {
    --bg-color: #0a0a0a;
    --card-bg: rgba(15, 15, 15, 0.75);
    --primary-color: #e50914;
    --primary-hover: #ff2a3b;
    --primary-glow: rgba(229, 9, 20, 0.4);
    --text-color: #ffffff;
    --text-muted: #a0a0a0;
    --border-color: rgba(255, 255, 255, 0.08);
    --border-red-subtle: rgba(229, 9, 20, 0.25);
    --border-red-focus: rgba(255, 42, 59, 0.8);
    --font-family: 'Outfit', sans-serif;
    --transition-speed: 0.3s;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: var(--font-family);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
    position: relative;
}

/* Beautiful Glowing Background Elements */
body::before, body::after {
    content: '';
    position: absolute;
    width: 350px;
    height: 350px;
    border-radius: 50%;
    background: radial-gradient(circle, var(--primary-color) 0%, rgba(229, 9, 20, 0) 70%);
    filter: blur(80px);
    z-index: 0;
    opacity: 0.15;
    pointer-events: none;
    animation: floatGlow 10s ease-in-out infinite alternate;
}

body::before {
    top: 15%;
    left: 15%;
}

body::after {
    bottom: 15%;
    right: 15%;
    animation-delay: -5s;
}

@keyframes floatGlow {
    0% {
        transform: translate(0, 0) scale(1);
    }
    100% {
        transform: translate(30px, -30px) scale(1.15);
    }
}

/* Centered Icon above the main Logo */
.icon-top-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    margin-bottom: -1rem; /* pull the main logo closer to the icon */
    filter: drop-shadow(0 0 15px rgba(229, 9, 20, 0.4));
    animation: fadeInIcon 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-icon {
    width: 60px;
    height: 60px;
    background-color: #ffffff;
    border-radius: 50%;
    padding: 8px;
    object-fit: contain;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    transition: transform var(--transition-speed);
}

.top-icon:hover {
    transform: scale(1.08);
}

@keyframes fadeInIcon {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Page Wrapper to center logo and login card */
.page-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 440px;
    z-index: 1;
    gap: 1.25rem; /* Reduced gap to separate from the login card */
    padding: 1rem;
}

.logo-top-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    filter: drop-shadow(0 4px 12px rgba(229, 9, 20, 0.2));
    animation: fadeInLogo 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

.top-logo {
    max-width: 220px;
    width: 100%;
    height: auto;
    display: block;
    margin: 0 auto;
    object-fit: contain;
    transition: transform var(--transition-speed);
}

.top-logo:hover {
    transform: scale(1.03);
}

@keyframes fadeInLogo {
    from {
        opacity: 0;
        transform: translateY(-15px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card Container with Glassmorphism */
.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    padding: 2.5rem;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-red-subtle);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), 
                0 0 50px rgba(229, 9, 20, 0.05);
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.login-container:hover {
    border-color: rgba(229, 9, 20, 0.4);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.6), 
                0 0 60px rgba(229, 9, 20, 0.1);
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Header Typography */
.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 2.5rem;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
    display: inline-block;
    filter: drop-shadow(0 0 10px rgba(229, 9, 20, 0.5));
    animation: pulseLogo 3s ease-in-out infinite;
}

@keyframes pulseLogo {
    0%, 100% {
        transform: scale(1);
        filter: drop-shadow(0 0 8px rgba(229, 9, 20, 0.4));
    }
    50% {
        transform: scale(1.05);
        filter: drop-shadow(0 0 16px rgba(229, 9, 20, 0.7));
    }
}

.login-header h1 {
    font-size: 1.85rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, #ffffff 60%, #ffcbd1 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.login-header p {
    color: var(--text-muted);
    font-size: 0.95rem;
}

/* Form Styles */
.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    transition: color var(--transition-speed);
}

.input-container {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 1rem;
    color: var(--text-muted);
    font-size: 1.2rem;
    pointer-events: none;
    transition: color var(--transition-speed);
}

.form-input {
    width: 100%;
    padding: 0.85rem 1rem 0.85rem 2.8rem;
    background-color: rgba(20, 20, 20, 0.6);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-color);
    font-family: var(--font-family);
    font-size: 0.95rem;
    outline: none;
    transition: all var(--transition-speed);
}

.form-input:focus {
    background-color: rgba(10, 10, 10, 0.9);
    border-color: var(--border-red-focus);
    box-shadow: 0 0 0 3px rgba(229, 9, 20, 0.15);
}

.form-input:focus ~ .input-icon {
    color: var(--primary-color);
}

.form-group:focus-within label {
    color: var(--primary-hover);
}

/* Styled Select Elements */
select.form-input {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23ff2a3b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.1em;
    padding-right: 2.5rem;
}

select.form-input option {
    background-color: #121212;
    color: var(--text-color);
}

/* Error/Message styles */
.alert {
    padding: 0.85rem 1rem;
    border-radius: 12px;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    animation: shake 0.4s ease-in-out;
}

.alert-danger {
    background: rgba(229, 9, 20, 0.15);
    border: 1px solid rgba(229, 9, 20, 0.3);
    color: #ffcbd1;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-6px); }
    75% { transform: translateX(6px); }
}

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 0.95rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, #b8060f 100%);
    border: none;
    border-radius: 12px;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-primary::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: all 0.6s ease;
}

.btn-primary:hover {
    background: linear-gradient(135deg, var(--primary-hover) 0%, var(--primary-color) 100%);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.5),
                0 0 15px rgba(255, 42, 59, 0.2);
    transform: translateY(-2px);
}

.btn-primary:hover::after {
    left: 100%;
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(229, 9, 20, 0.3);
}

/* Footer / Extra info */
.login-footer {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.login-footer a {
    color: var(--primary-hover);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition-speed);
}

.login-footer a:hover {
    color: #ffffff;
    text-shadow: 0 0 8px rgba(229, 9, 20, 0.5);
}

/* --- Token & Dashboard Pages Styles --- */
.dashboard-container {
    width: 100%;
    max-width: 800px;
    margin: 2rem;
    padding: 3rem;
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-red-subtle);
    border-radius: 24px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    z-index: 1;
    animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
    margin-bottom: 2rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: rgba(229, 9, 20, 0.08);
    padding: 0.5rem 1rem;
    border-radius: 30px;
    border: 1px solid var(--border-red-subtle);
    font-size: 0.9rem;
}

.user-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--primary-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.85rem;
}

.dashboard-title h2 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.25rem;
}

.dashboard-title p {
    color: var(--text-muted);
}

/* Card layout inside dashboards */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.info-card {
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all var(--transition-speed);
}

.info-card:hover {
    border-color: var(--border-red-subtle);
    background: rgba(255, 255, 255, 0.04);
    transform: translateY(-4px);
}

.info-card h3 {
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 0.5rem;
}

.info-card .card-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #ffffff;
}

.info-card .card-value.accent {
    color: var(--primary-color);
    text-shadow: 0 0 10px rgba(229, 9, 20, 0.3);
}

/* Token Generation UI */
.token-section {
    background: rgba(20, 20, 20, 0.8);
    border: 1px solid var(--border-red-subtle);
    border-radius: 16px;
    padding: 2rem;
    text-align: center;
    margin-bottom: 2rem;
    position: relative;
    overflow: hidden;
}

.token-section::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(229, 9, 20, 0.05) 0%, transparent 60%);
    pointer-events: none;
}

.token-display {
    font-family: monospace;
    font-size: 2.2rem;
    font-weight: 700;
    letter-spacing: 4px;
    color: var(--primary-hover);
    background: rgba(0, 0, 0, 0.4);
    padding: 1rem;
    border-radius: 12px;
    display: inline-block;
    margin: 1.5rem 0;
    border: 1px dashed var(--primary-color);
    text-shadow: 0 0 15px rgba(255, 42, 59, 0.4);
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: #ffffff;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-speed);
    cursor: pointer;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-muted);
}

.btn-logout {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.5rem;
    background: rgba(229, 9, 20, 0.1);
    border: 1px solid var(--border-red-subtle);
    border-radius: 12px;
    color: #ffcbd1;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--transition-speed);
}

.btn-logout:hover {
    background: var(--primary-color);
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(229, 9, 20, 0.4);
}

/* Animations for token generated */
.success-checkmark {
    width: 60px;
    height: 60px;
    margin: 0 auto 1rem;
    background: rgba(229, 9, 20, 0.15);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary-hover);
    font-size: 1.8rem;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 20px rgba(229, 9, 20, 0.2);
}

/* Responsive adjustments */
@media (max-width: 480px) {
    .login-container {
        padding: 1.5rem;
        border-radius: 16px;
    }
    
    .dashboard-container {
        padding: 1.5rem;
        margin: 1rem;
    }
    
    .dashboard-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
    }
    
    .token-display {
        font-size: 1.8rem;
        letter-spacing: 2px;
    }
}

/* Styled Native Dropdown Select */
.select-container {
    position: relative;
    width: 100%;
    margin-bottom: 2rem;
}

.dropdown-select {
    width: 100%;
    padding: 1.1rem 1.5rem 1.1rem 3.2rem;
    background-color: rgba(20, 20, 20, 0.6);
    border: 1.5px solid var(--border-color);
    border-radius: 14px;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 1rem;
    outline: none;
    cursor: pointer;
    transition: all var(--transition-speed);
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23e50914' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 1.25rem center;
    background-size: 1.1em;
}

.dropdown-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 15px rgba(229, 9, 20, 0.2);
    background-color: rgba(10, 10, 10, 0.9);
}

.dropdown-select option {
    background-color: #121212;
    color: #ffffff;
    padding: 1rem;
}

/* Home Button - enhanced */
.btn-home {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.75rem 1.8rem;
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-hover) 100%);
    border: none;
    border-radius: 14px;
    color: #ffffff;
    font-family: var(--font-family);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all var(--transition-speed) cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(229, 9, 20, 0.3), 0 0 15px rgba(255, 42, 59, 0.15);
    position: relative;
    overflow: hidden;
    animation: fadeIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Shine effect */
.btn-home::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
    transition: all 0.6s ease;
}

.btn-home:hover {
    background: var(--primary-hover);
    color: #ffffff;
    border-color: var(--primary-hover);
    box-shadow: 0 6px 20px rgba(229, 9, 20, 0.5), 0 0 20px rgba(255, 42, 59, 0.2);
    transform: translateY(-2px);
}

.btn-home:hover::after {
    left: 100%;
}

.btn-home:active {
    transform: translateY(0);
}



