:root {
    --primary: #4f46e5;
    --secondary: #4338ca;
    /* Darker shade of primary for hover */
    --accent: #db2777;
    --bg-color: #f8fafc;
    --container-bg: #ffffff;
    --text-color: #1e293b;
    --text-muted: #64748b;
    --border-color: #e2e8f0;
    --input-bg: #ffffff;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body {
    background-color: var(--bg-color);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: var(--text-color);
    overflow-x: hidden;
}

/* Flat Container (formerly glass) */
.glass-container {
    background: var(--container-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    /* Reduced radius */
    padding: 3rem;
    width: 100%;
    max-width: 480px;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1), 0 1px 2px 0 rgba(0, 0, 0, 0.06);
    /* Subtle shadow */
}

h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    text-align: center;
    color: var(--text-color);
    /* Solid color */
}

p.subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 2rem;
    font-size: 0.95rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-color);
    font-weight: 500;
}

input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    /* standard flat radius */
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-color);
    font-size: 1rem;
    transition: border-color 0.2s;
}

input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

button {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    border: none;
    background: var(--primary);
    /* Solid color */
    color: white;
    font-size: 1rem;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
    box-shadow: none;
}

button:hover {
    background-color: var(--secondary);
    transform: none;
    box-shadow: none;
}

button:active {
    transform: none;
}

.links {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.9rem;
}

.links a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.links a:hover {
    color: var(--secondary);
    text-decoration: underline;
}

/* Alert Messages */
.alert {
    padding: 1rem;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
    text-align: center;
    font-weight: 500;
}

.alert-error {
    background: #fee2e2;
    border: 1px solid #fecaca;
    color: #991b1b;
}

.alert-success {
    background: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #166534;
}

/* Dashboard Specifics */
.dashboard-container {
    max-width: 800px;
    padding: 2rem;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1.5rem;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

@keyframes wave {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-5deg);
    }

    75% {
        transform: rotate(5deg);
    }
}

@keyframes wave-hand {

    0%,
    100% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-20deg);
    }

    75% {
        transform: rotate(10deg);
    }
}

.avatar-container {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
    position: relative;
    flex-shrink: 0;
    /* Prevent shrinking if flex container is tight */
}

.avatar-body {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-hand {
    position: absolute;
    width: 28px;
    height: 28px;
    bottom: -5px;
    right: -2px;
    object-fit: contain;
    animation: wave-hand 2s ease-in-out infinite;
    transform-origin: bottom right;
}

.logout-btn {
    background: white;
    padding: 0.5rem 1.2rem;
    width: auto;
    font-size: 0.9rem;
    color: #ef4444;
    border: 1px solid #fee2e2;
    border-radius: 6px;
    /* Consistent flat radius */
    font-weight: 500;
    transition: all 0.2s ease;
    text-decoration: none;
    letter-spacing: normal;
    box-shadow: none;
}

.logout-btn:hover {
    background: #fef2f2;
    color: #dc2626;
    border-color: #fecaca;
    transform: none;
    box-shadow: none;
}

.card {
    background: white;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: none;
}

.card h2 {
    margin-bottom: 1rem;
    font-size: 1.25rem;
    color: var(--text-color);
    font-weight: 600;
}

.current-model-display {
    background: #f1f5f9;
    border: 1px solid var(--border-color);
    padding: 0.75rem;
    border-radius: 6px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    color: #059669;
    word-break: break-all;
}

.input-group {
    display: flex;
    gap: 0.75rem;
}

.input-group input {
    flex: 1;
}

.input-group button {
    width: auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    white-space: nowrap;
}

.app-link {
    background: white;
    color: var(--primary);
    padding: 0.75rem;
    border-radius: 6px;
    display: inline-block;
    width: 100%;
    text-align: center;
    border: 1px solid var(--border-color);
    font-weight: 500;
    transition: all 0.2s;
}

.app-link:hover {
    background: #f8fafc;
    color: var(--secondary);
    border-color: #cbd5e1;
    text-decoration: none;
}

@media (max-width: 600px) {
    .glass-container {
        margin: 1rem;
        padding: 1.5rem;
        box-shadow: none;
        border: none;
        background: transparent;
    }

    .input-group {
        flex-direction: column;
    }

    .input-group button {
        width: 100%;
    }
}