:root {
    --color-bg: #030712;
    --color-card-bg: rgba(17, 24, 39, 0.6);
    --color-border: rgba(255, 255, 255, 0.08);
    --color-primary: #3b82f6;
    --color-primary-dark: #1d4ed8;
    --color-accent: #00f2fe;
    --color-text-main: #f3f4f6;
    --color-text-muted: #9ca3af;
    --color-error: #ef4444;
    --color-success: #10b981;
}

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

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

/* Cosmic Background */
.stars-bg {
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 50% 50%, #111827 0%, #030712 100%);
    z-index: -1;
}

.portal-container {
    width: 100%;
    max-width: 800px;
    padding: 2rem;
    z-index: 10;
}

/* Glassmorphism Card Base */
.auth-card, .services-card {
    background: var(--color-card-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--color-border);
    border-radius: 24px;
    padding: 3rem 2.5rem;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    text-align: center;
    transition: all 0.3s ease;
}

.auth-card {
    max-width: 450px;
    margin: 0 auto;
}

/* Logo and Header */
.logo-area {
    font-family: 'Outfit', sans-serif;
    font-size: 2.25rem;
    font-weight: 800;
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
    color: white;
}

.text-gradient-icon {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 0 15px rgba(0, 242, 254, 0.4));
}

.text-gradient {
    background: linear-gradient(135deg, var(--color-accent) 0%, var(--color-primary) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.subtitle {
    color: var(--color-text-muted);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 2rem;
}

/* Forms */
.auth-form {
    display: none;
    text-align: left;
}

.auth-form.active {
    display: block;
    animation: fadeIn 0.4s ease-out;
}

.form-group {
    margin-bottom: 1.5rem;
}

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

.form-group label i {
    margin-right: 0.25rem;
    color: var(--color-primary);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1.25rem;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    color: white;
    font-size: 0.95rem;
    font-family: inherit;
    transition: all 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.15);
    background: rgba(0, 0, 0, 0.5);
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 0.875rem;
    background: linear-gradient(135deg, var(--color-primary) 0%, var(--color-primary-dark) 100%);
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
}

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

.switch-form-text {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.switch-form-text a {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
}

.switch-form-text a:hover {
    text-decoration: underline;
}

/* Messages */
.error-msg {
    color: var(--color-error);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: none;
}

.success-msg {
    color: var(--color-success);
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 1rem;
    display: none;
}

/* Services Grid (Post-login) */
.user-welcome {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.5rem;
    margin-top: 2rem;
    margin-bottom: 2.5rem;
    text-align: left;
}

.service-item {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--color-border);
    border-radius: 20px;
    padding: 2rem 1.5rem;
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.service-item:not(.disabled):hover {
    transform: translateY(-5px);
    border-color: rgba(255, 255, 255, 0.2);
    background: rgba(255, 255, 255, 0.02);
    box-shadow: 0 15px 30px -10px rgba(0, 0, 0, 0.5);
}

.service-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-bottom: 1.25rem;
}

.red-glow {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
}

.blue-glow {
    background: rgba(59, 130, 246, 0.1);
    color: #3b82f6;
}

.green-glow {
    background: rgba(16, 185, 129, 0.1);
    color: #10b981;
}

.service-item h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.service-item p {
    color: var(--color-text-muted);
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.btn-service {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    display: flex;
    align-items: center;
    gap: 0.25rem;
    transition: gap 0.2s;
}

.service-item:hover .btn-service {
    gap: 0.5rem;
}

/* Disabled State */
.service-item.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.status-badge {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-size: 0.7rem;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.08);
    color: var(--color-text-muted);
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    text-transform: uppercase;
}

.btn-logout {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    padding: 0.75rem 1.5rem;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-logout:hover {
    background: rgba(239, 68, 68, 0.1);
    color: #ef4444;
    border-color: rgba(239, 68, 68, 0.2);
}

/* Animations */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 600px) {
    .auth-card, .services-card {
        padding: 2rem 1.5rem;
    }
}
