:root {
    /* iOS System Colors */
    --primary-color: #007AFF;
    --primary-dark: #0051D5;
    --success-color: #34C759;
    --error-color: #FF3B30;
    --warning-color: #FF9500;

    /* Backgrounds */
    --bg-primary: #FFFFFF;
    --bg-secondary: #F8F9FA;
    --bg-tertiary: #E9ECEF;

    /* Text Colors */
    --text-primary: #1A1A1A;
    --text-secondary: #4A4A4A;
    --text-tertiary: #7A7A7A;

    /* Borders */
    --border-color: #E0E0E0;
    --separator-color: #F1F3F4;

    /* Shadows - More subtle for app feel */
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 15px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);

    /* Spacing */
    --spacing-xs: 8px;
    --spacing-sm: 12px;
    --spacing-md: 16px;
    --spacing-lg: 24px;
    --spacing-xl: 32px;

    /* Border Radius */
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --radius-xl: 20px;

    /* Transitions */
    --transition-fast: 0.15s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Reset & Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* Typography */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-weight: 600;
    line-height: 1.2;
}

h1 {
    font-size: 28px;
}

h2 {
    font-size: 24px;
}

h3 {
    font-size: 20px;
}

h4 {
    font-size: 18px;
}

h5 {
    font-size: 16px;
}

h6 {
    font-size: 14px;
}

/* Auth Container */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    background: linear-gradient(135deg, #F2F2F7 0%, #E5E5EA 100%);
}

.auth-card {
    width: 100%;
    max-width: 400px;
    background: var(--bg-primary);
    border-radius: var(--radius-xl);
    padding: var(--spacing-xl);
    box-shadow: var(--shadow-lg);
    animation: slideUp 0.4s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.auth-header {
    text-align: center;
    margin-bottom: var(--spacing-xl);
}

.app-icon {
    display: inline-block;
    margin-bottom: var(--spacing-md);
    animation: scaleIn 0.5s ease;
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.app-title {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-xs);
}

.app-subtitle {
    font-size: 15px;
    color: var(--text-tertiary);
}

/* Forms */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-md);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-xs);
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-secondary);
}

.form-group input {
    width: 100%;
    padding: 14px 16px;
    font-size: 16px;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    background: var(--bg-primary);
    color: var(--text-primary);
    transition: all var(--transition-fast);
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
}

.form-group input::placeholder {
    color: var(--text-tertiary);
}

/* Buttons */
.btn-primary,
.btn-secondary {
    width: 100%;
    padding: 14px 24px;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all var(--transition-fast);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-xs);
    text-decoration: none;
    font-family: inherit;
}

.btn-primary {
    background: var(--primary-color);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-primary:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-secondary {
    background: var(--bg-secondary);
    color: var(--primary-color);
}

.btn-secondary:hover {
    background: var(--bg-tertiary);
}

/* Spinner */
.spinner {
    animation: rotate 1s linear infinite;
    width: 20px;
    height: 20px;
}

.spinner .path {
    stroke: white;
    stroke-linecap: round;
    animation: dash 1.5s ease-in-out infinite;
}

@keyframes rotate {
    100% {
        transform: rotate(360deg);
    }
}

@keyframes dash {
    0% {
        stroke-dasharray: 1, 150;
        stroke-dashoffset: 0;
    }

    50% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -35;
    }

    100% {
        stroke-dasharray: 90, 150;
        stroke-dashoffset: -124;
    }
}

/* Auth Divider */
.auth-divider {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    margin: var(--spacing-md) 0;
    color: var(--text-tertiary);
    font-size: 14px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--separator-color);
}

/* Auth Footer */
.auth-footer {
    margin-top: var(--spacing-lg);
    padding-top: var(--spacing-lg);
    border-top: 1px solid var(--separator-color);
}

.demo-credentials {
    font-size: 13px;
    color: var(--text-tertiary);
    text-align: center;
    line-height: 1.6;
}

.demo-credentials strong {
    color: var(--text-secondary);
    display: block;
    margin-bottom: var(--spacing-xs);
}

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(-100px);
    background: var(--text-primary);
    color: white;
    padding: 14px 24px;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-lg);
    font-size: 15px;
    font-weight: 500;
    z-index: 10000;
    opacity: 0;
    transition: all var(--transition-normal);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.toast.toast-success {
    background: var(--success-color);
}

.toast.toast-error {
    background: var(--error-color);
}

.toast.toast-warning {
    background: var(--warning-color);
}

/* Page Container */
.page-container {
    min-height: 100vh;
    padding-bottom: 80px;
    background: var(--bg-secondary);
}

/* Page Header */
.page-header {
    background: var(--bg-primary);
    padding: var(--spacing-md);
    border-bottom: 1px solid var(--separator-color);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.page-title {
    font-size: 22px;
    font-weight: 700;
    color: var(--text-primary);
    text-align: center;
}

/* Content */
.content {
    padding: var(--spacing-md);
}

/* Card */
.card {
    background: var(--bg-primary);
    border-radius: var(--radius-lg);
    padding: var(--spacing-md);
    margin-bottom: var(--spacing-md);
    box-shadow: var(--shadow-sm);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--spacing-md);
}

.card-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
}

/* Bottom Navigation */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-primary);
    border-top: 1px solid var(--separator-color);
    display: flex;
    justify-content: space-around;
    padding: 12px 0 calc(12px + env(safe-area-inset-bottom));
    z-index: 1000;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.03);
}

.nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 4px;
    text-decoration: none;
    color: var(--text-tertiary);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active .nav-icon {
    transform: translateY(-2px);
}

.nav-icon {
    width: 26px;
    height: 26px;
    transition: transform 0.2s ease;
}

.nav-label {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.2px;
}

/* Locked Navigation Items */
.nav-item.locked {
    opacity: 0.5;
    cursor: not-allowed;
}

.nav-item.locked:active {
    transform: none;
}

.nav-icon-wrapper {
    position: relative;
    width: 26px;
    height: 26px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lock-icon {
    position: absolute;
    bottom: -2px;
    right: -4px;
    font-size: 10px;
    background: white;
    border-radius: 50%;
    width: 14px;
    height: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

/* Responsive */
@media (max-width: 375px) {
    .auth-card {
        padding: var(--spacing-lg);
    }

    h1 {
        font-size: 24px;
    }

    h2 {
        font-size: 20px;
    }
}

/* Safe Area Support */
@supports (padding: max(0px)) {
    .page-container {
        padding-left: max(0px, env(safe-area-inset-left));
        padding-right: max(0px, env(safe-area-inset-right));
    }
}