:root {
    --primary: #6366f1;
    --primary-hover: #4f46e5;
    --danger: #ef4444;
    --danger-hover: #dc2626;
    --bg-dark: #0f172a;
    --card-bg: rgba(30, 41, 59, 0.7);
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --border-color: rgba(255, 255, 255, 0.1);
    --input-bg: rgba(15, 23, 42, 0.6);
}

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

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

/* Dynamic Animated Background */
.background-container {
    position: absolute;
    width: 100vw;
    height: 100vh;
    z-index: 0;
    overflow: hidden;
}

.blob {
    position: absolute;
    filter: blur(80px);
    border-radius: 50%;
    animation: float 20s infinite alternate cubic-bezier(0.5, 0, 0.5, 1);
    opacity: 0.5;
}

.blob-1 {
    width: 400px;
    height: 400px;
    background: #4f46e5;
    top: -100px;
    left: -100px;
    animation-duration: 25s;
}

.blob-2 {
    width: 500px;
    height: 500px;
    background: #ec4899;
    bottom: -150px;
    right: -100px;
    animation-duration: 22s;
    animation-delay: -5s;
}

@keyframes float {
    0% { transform: translate(0, 0) scale(1); }
    50% { transform: translate(100px, 50px) scale(1.2); }
    100% { transform: translate(-50px, 100px) scale(0.9); }
}

/* Glassmorphism Card */
.app-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    padding: 20px;
}

.card {
    background: var(--card-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transition: all 0.4s ease;
}

.hidden-view {
    display: none !important;
}

.brand {
    text-align: center;
    margin-bottom: 30px;
}

.logo {
    width: 60px;
    height: 60px;
    background: linear-gradient(135deg, var(--primary), #ec4899);
    border-radius: 16px;
    margin: 0 auto 15px;
    box-shadow: 0 10px 20px rgba(99, 102, 241, 0.3);
}

.brand h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 5px;
    letter-spacing: -0.5px;
}

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

/* Forms */
form {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

form.active-form {
    display: block;
}

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

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

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

.input-group input {
    width: 100%;
    padding: 14px 16px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all 0.3s ease;
    outline: none;
}

.input-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.btn {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-bottom: 15px;
    font-family: inherit;
}

.primary-btn {
    background: var(--primary);
    color: white;
    box-shadow: 0 4px 15px rgba(99, 102, 241, 0.3);
}

.primary-btn:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(99, 102, 241, 0.4);
}

.danger-btn {
    background: var(--danger);
    color: white;
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.3);
}

.danger-btn:hover {
    background: var(--danger-hover);
    transform: translateY(-2px);
}

.outline-btn {
    background: transparent;
    color: var(--text-main);
    border: 1px solid var(--border-color);
}

.outline-btn:hover {
    background: rgba(255, 255, 255, 0.05);
}

.toggle-text {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 20px;
}

.link {
    color: var(--primary);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s;
}

.link:hover {
    color: #818cf8;
    text-decoration: underline;
}

/* Messages */
.message {
    font-size: 0.85rem;
    margin-bottom: 15px;
    padding: 10px;
    border-radius: 8px;
    display: none;
    text-align: center;
}

.error-message {
    background: rgba(239, 68, 68, 0.1);
    color: #fca5a5;
    border: 1px solid rgba(239, 68, 68, 0.2);
}

.success-message {
    background: rgba(34, 197, 94, 0.1);
    color: #86efac;
    border: 1px solid rgba(34, 197, 94, 0.2);
}

.dashboard-actions {
    margin-top: 30px;
}

/* Module Navigation Cards */
.modules-grid {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 10px;
}

.module-card {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 16px 18px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    transition: all 0.3s ease;
    cursor: pointer;
}

.module-card:hover {
    background: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.module-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.module-info {
    flex: 1;
    min-width: 0;
}

.module-info h3 {
    font-size: 0.95rem;
    font-weight: 700;
    margin-bottom: 2px;
}

.module-info p {
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.3;
}

.module-arrow {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.3s, color 0.3s;
}

.module-card:hover .module-arrow {
    transform: translateX(4px);
    color: var(--primary);
}
