* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #1a73e8;
    --primary-hover: #1557b0;
    --bg-color: #f8f9fa;
    --surface-color: #ffffff;
    --text-primary: #202124;
    --text-secondary: #5f6368;
    --border-color: #dadce0;
    --error-color: #d93025;
    --badge-bg: #e8f0fe;
    --badge-color: #1967d2;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.6;
}

.screen {
    display: block;
}

.screen.hidden {
    display: none;
}

/* Auth Screen */
.auth-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 2rem;
}

.logo {
    text-align: center;
    margin-bottom: 3rem;
}

.logo h1 {
    font-size: 3rem;
    font-weight: 600;
    color: var(--primary-color);
    margin-bottom: 0.5rem;
}

.subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.btn-primary {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 0.875rem 2rem;
    font-size: 1rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.btn-primary:hover {
    background-color: var(--primary-hover);
}

.btn-secondary {
    background-color: transparent;
    color: var(--primary-color);
    border: 1px solid var(--border-color);
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: var(--bg-color);
}

.error-message {
    margin-top: 1rem;
    padding: 1rem;
    background-color: #fce8e6;
    color: var(--error-color);
    border-radius: 4px;
    font-size: 0.875rem;
    max-width: 400px;
    text-align: center;
    display: none;
}

.error-message.show {
    display: block;
}

/* Portal Screen */
.header {
    background-color: var(--surface-color);
    border-bottom: 1px solid var(--border-color);
    padding: 1rem 0;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 500;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.user-email {
    color: var(--text-secondary);
    font-size: 0.875rem;
}

/* Main Content */
.main-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 3rem 2rem;
}

.tiles-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
}

.tile {
    background-color: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 2rem;
    transition: transform 0.2s, box-shadow 0.2s;
    cursor: pointer;
    position: relative;
}

.tile:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

.tile.disabled {
    opacity: 0.6;
    cursor: default;
}

.tile.disabled:hover {
    transform: none;
    box-shadow: none;
}

.tile-icon {
    font-size: 3rem;
    margin-bottom: 1rem;
}

.tile h3 {
    font-size: 1.25rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
}

.tile p {
    color: var(--text-secondary);
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.badge {
    display: inline-block;
    background-color: var(--badge-bg);
    color: var(--badge-color);
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
}

/* Loading Screen */
#loading-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
}

.loader {
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Responsive */
@media (max-width: 768px) {
    .header-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }

    .user-info {
        flex-direction: column;
        gap: 0.5rem;
    }

    .tiles-container {
        grid-template-columns: 1fr;
    }
}

.portal-note {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0 0 1.5rem;
}

a.tile {
    text-decoration: none;
    color: inherit;
    display: block;
}

.badge-live {
    background-color: #dcfce7;
    color: #166534;
}
