/* ===== Reset & Base ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

    --purple-500: #8b5cf6;
    --purple-600: #7c3aed;
    --purple-700: #6d28d9;
    --blue-500: #3b82f6;
    --blue-600: #2563eb;
    --blue-700: #1d4ed8;
    --teal-500: #14b8a6;
    --teal-600: #0d9488;
    --teal-700: #0f766e;

    --gray-50: #f8fafc;
    --gray-100: #f1f5f9;
    --gray-200: #e2e8f0;
    --gray-300: #cbd5e1;
    --gray-400: #94a3b8;
    --gray-500: #64748b;
    --gray-600: #475569;
    --gray-700: #334155;
    --gray-800: #1e293b;
    --gray-900: #0f172a;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -2px rgba(0, 0, 0, 0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
    --shadow-2xl: 0 25px 50px -12px rgba(0, 0, 0, 0.25);

    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    line-height: 1.6;
    color: var(--gray-800);
    -webkit-font-smoothing: antialiased;
}

/* ===== Login Page ===== */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
    position: relative;
    overflow: hidden;
    padding: 1.5rem;
}

.login-bg-shapes {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
}

.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.5;
    animation: float 8s ease-in-out infinite;
}

.shape-1 {
    width: 400px;
    height: 400px;
    background: var(--purple-600);
    top: -100px;
    left: -100px;
}

.shape-2 {
    width: 350px;
    height: 350px;
    background: var(--blue-600);
    bottom: -80px;
    right: -80px;
    animation-delay: -3s;
}

.shape-3 {
    width: 250px;
    height: 250px;
    background: var(--teal-600);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: -5s;
}

@keyframes float {
    0%, 100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-20px) scale(1.05); }
}

.login-container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
}

.login-card {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: var(--radius-xl);
    padding: 2.5rem;
    box-shadow: var(--shadow-2xl), 0 0 0 1px rgba(255, 255, 255, 0.1);
    animation: slideUp 0.6s ease-out;
}

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

.login-header {
    text-align: center;
    margin-bottom: 2rem;
}

.login-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    border-radius: var(--radius-lg);
    color: white;
    margin-bottom: 1.25rem;
    box-shadow: 0 8px 24px rgba(139, 92, 246, 0.4);
}

.login-header h1 {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

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

.alert {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1rem;
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
}

.alert-error {
    background: #fef2f2;
    color: #dc2626;
    border: 1px solid #fecaca;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--gray-700);
}

.form-group input {
    width: 100%;
    padding: 0.875rem 1rem;
    border: 2px solid var(--gray-200);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    color: var(--gray-800);
    background: var(--gray-50);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}

.form-group input::placeholder {
    color: var(--gray-400);
}

.form-group input:focus {
    outline: none;
    border-color: var(--purple-500);
    background: white;
    box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.15);
}

/* ===== Buttons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    border-radius: var(--radius-md);
    border: none;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition);
}

.btn-primary {
    width: 100%;
    padding: 1rem 1.5rem;
    background: linear-gradient(135deg, var(--purple-600), var(--blue-600));
    color: white;
    box-shadow: 0 4px 14px rgba(124, 58, 237, 0.4);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(124, 58, 237, 0.5);
}

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

.btn-outline {
    background: transparent;
    color: var(--gray-600);
    border: 2px solid var(--gray-200);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
}

.btn-outline:hover {
    background: var(--gray-100);
    border-color: var(--gray-300);
    color: var(--gray-800);
}

/* ===== Dashboard Page ===== */
.dashboard-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, var(--gray-50) 0%, #eef2ff 100%);
}

.dashboard-header {
    background: white;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-sm);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1rem 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.header-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.brand-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--purple-500), var(--blue-500));
    border-radius: var(--radius-sm);
    color: white;
}

.header-brand h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--gray-900);
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-badge {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--gray-100);
    border-radius: 999px;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-600);
}

.dashboard-main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2.5rem 1.5rem;
    width: 100%;
}

.dashboard-intro {
    text-align: center;
    margin-bottom: 2.5rem;
}

.dashboard-intro h2 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.5rem;
}

.dashboard-intro p {
    color: var(--gray-500);
    font-size: 1.05rem;
}

/* ===== Server Grid ===== */
.server-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.server-card {
    position: relative;
    display: block;
    text-decoration: none;
    color: inherit;
    border-radius: var(--radius-xl);
    overflow: hidden;
    background: white;
    box-shadow: var(--shadow-lg);
    transition: transform var(--transition), box-shadow var(--transition);
    animation: fadeInUp 0.5s ease-out backwards;
    animation-delay: var(--card-delay, 0s);
}

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

.server-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-2xl);
}

.server-card__glow {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    transition: height var(--transition);
}

.server-card:hover .server-card__glow {
    height: 6px;
}

.server-card--purple .server-card__glow {
    background: linear-gradient(90deg, var(--purple-500), var(--purple-700));
}

.server-card--blue .server-card__glow {
    background: linear-gradient(90deg, var(--blue-500), var(--blue-700));
}

.server-card--teal .server-card__glow {
    background: linear-gradient(90deg, var(--teal-500), var(--teal-700));
}

.server-card__content {
    padding: 2rem;
    position: relative;
}

.server-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: var(--radius-md);
    margin-bottom: 1.25rem;
    transition: transform var(--transition);
}

.server-card:hover .server-card__icon {
    transform: scale(1.1);
}

.server-card--purple .server-card__icon {
    background: linear-gradient(135deg, rgba(139, 92, 246, 0.15), rgba(124, 58, 237, 0.25));
    color: var(--purple-600);
}

.server-card--blue .server-card__icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.15), rgba(37, 99, 235, 0.25));
    color: var(--blue-600);
}

.server-card--teal .server-card__icon {
    background: linear-gradient(135deg, rgba(20, 184, 166, 0.15), rgba(13, 148, 136, 0.25));
    color: var(--teal-600);
}

.server-card__heading {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gray-900);
    margin-bottom: 0.75rem;
}

.server-card__description {
    font-size: 0.9rem;
    color: var(--gray-500);
    line-height: 1.7;
    margin-bottom: 1.5rem;
    min-height: 3rem;
}

.server-card__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid var(--gray-100);
}

.server-card__link-text {
    font-size: 0.875rem;
    font-weight: 600;
    transition: color var(--transition);
}

.server-card--purple .server-card__link-text { color: var(--purple-600); }
.server-card--blue .server-card__link-text { color: var(--blue-600); }
.server-card--teal .server-card__link-text { color: var(--teal-600); }

.server-card__footer svg {
    transition: transform var(--transition);
}

.server-card--purple .server-card__footer svg { color: var(--purple-600); }
.server-card--blue .server-card__footer svg { color: var(--blue-600); }
.server-card--teal .server-card__footer svg { color: var(--teal-600); }

.server-card:hover .server-card__footer svg {
    transform: translate(3px, -3px);
}

.dashboard-footer {
    text-align: center;
    padding: 1.5rem;
    color: var(--gray-400);
    font-size: 0.875rem;
    border-top: 1px solid var(--gray-200);
    background: white;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .server-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 640px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .header-content {
        flex-direction: column;
        align-items: flex-start;
    }

    .header-actions {
        width: 100%;
        justify-content: space-between;
    }

    .dashboard-main {
        padding: 1.5rem 1rem;
    }

    .dashboard-intro h2 {
        font-size: 1.5rem;
    }

    .server-grid {
        grid-template-columns: 1fr;
    }

    .server-card__content {
        padding: 1.5rem;
    }
}
