:root {
    --bg-color: #000000;
    --text-primary: #ffffff;
    --text-secondary: #a1a1a6;
    --accent-color: #0a84ff;
    --glass-bg: rgba(28, 28, 30, 0.7);
    --glass-border: rgba(255, 255, 255, 0.1);
    --card-bg: #1c1c1e;
    --card-hover: #2c2c2e;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
    /* Prevent overscroll bounce background color mismatch on iOS */
    background-attachment: fixed; 
}

/* --- Login Page --- */
.login-body {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top right, #1a1a24, #000000);
}

.login-container {
    width: 100%;
    max-width: 400px;
    padding: 20px;
}

.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    animation: slideUp 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    opacity: 0;
    transform: translateY(20px);
}

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

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

.login-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    letter-spacing: -0.5px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 15px;
}

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

input[type="password"] {
    width: 100%;
    padding: 16px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    color: white;
    font-size: 16px;
    transition: all 0.3s ease;
}

input[type="password"]:focus {
    outline: none;
    border-color: var(--accent-color);
    background: rgba(255, 255, 255, 0.1);
}

.primary-button {
    width: 100%;
    padding: 16px;
    background-color: var(--accent-color);
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.1s ease, background-color 0.2s ease;
}

.primary-button:active {
    transform: scale(0.98);
    background-color: #0070e0;
}

.error-message {
    color: #ff453a;
    font-size: 14px;
    text-align: center;
    margin-bottom: 15px;
    min-height: 20px;
}

/* --- Dashboard --- */
.app-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 20px 40px;
}

.app-header {
    padding: 60px 0 30px;
    animation: fadeIn 0.8s ease forwards;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.app-header h1 {
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -1px;
}

.greeting {
    color: var(--text-secondary);
    font-size: 16px;
}

.icon-button {
    background: none;
    border: none;
    color: var(--accent-color);
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: rgba(10, 132, 255, 0.1);
    transition: background-color 0.2s ease;
}

.icon-button:active {
    background-color: rgba(10, 132, 255, 0.2);
}

.section-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    letter-spacing: -0.5px;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
}

/* Service Card */
.service-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    text-decoration: none;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    transition: transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1), background-color 0.2s ease;
    animation: scaleIn 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.service-card:active {
    transform: scale(0.95);
    background-color: var(--card-hover);
}

.service-icon {
    width: 50px;
    height: 50px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2c2c2e, #1c1c1e);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 24px;
    color: var(--accent-color);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.service-name {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.service-desc {
    font-size: 12px;
    color: var(--text-secondary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.loading-spinner {
    width: 30px;
    height: 30px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--accent-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 20px auto;
    grid-column: 1 / -1;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}
