:root {
    --primary: #4f46e5;
    --primary-dark: #4338ca;
    --danger: #ef4444;
    --success: #10b981;
    --warning: #f59e0b;
    --gray-100: #f3f4f6;
    --gray-800: #1f2937;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    line-height: 1.6;
    color: var(--gray-800);
    background: #f9fafb;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Navigation */
.navbar {
    background: white;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    padding: 1rem 0;
    margin-bottom: 2rem;
}

.navbar .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--primary);
    text-decoration: none;
}

.nav-links a {
    margin-left: 1.5rem;
    text-decoration: none;
    color: var(--gray-800);
    font-weight: 500;
}

.btn-primary,
.btn-logout {
    background: var(--primary);
    color: white !important;
    padding: 0.5rem 1.5rem;
    border-radius: 0.5rem;
    transition: background 0.2s;
}

.btn-primary:hover,
.btn-logout:hover {
    background: var(--primary-dark);
}

/* Forms */
.auth-container {
    max-width: 400px;
    margin: 2rem auto;
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.auth-container h2 {
    margin-bottom: 1.5rem;
    text-align: center;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    font-size: 0.875rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
    transition: border-color 0.2s;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    ring: 2px solid rgba(79, 70, 229, 0.2);
}

.error-message {
    color: var(--danger);
    font-size: 0.875rem;
    margin-top: 0.25rem;
    display: none;
}

.btn-submit {
    width: 100%;
    padding: 0.75rem;
    background: var(--primary);
    color: white;
    border: none;
    border-radius: 0.5rem;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 1rem;
}

.btn-submit:hover {
    background: var(--primary-dark);
}

.btn-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

/* Alerts */
.alert {
    padding: 1rem;
    border-radius: 0.5rem;
    margin-bottom: 1rem;
}

.alert-error {
    background: #fee2e2;
    color: #991b1b;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #d1fae5;
    color: #065f46;
    border: 1px solid #a7f3d0;
}

.alert-info {
    background: #dbeafe;
    color: #1e40af;
    border: 1px solid #bfdbfe;
}

/* Protected content */
.dashboard {
    background: white;
    padding: 2rem;
    border-radius: 1rem;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.user-info {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--gray-100);
    border-radius: 0.5rem;
}

/* Homepage buttons integration */
.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.125rem;
    border-radius: 0.75rem;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.btn-secondary {
    background: white;
    color: var(--gray-800);
    border: 2px solid #e5e7eb;
}

.btn-secondary:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.password-strength {
    height: 4px;
    background: #e5e7eb;
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    width: 0;
    transition: all 0.3s;
    border-radius: 2px;
}

.strength-weak {
    background: var(--danger);
    width: 33%;
}

.strength-medium {
    background: var(--warning);
    width: 66%;
}

.strength-strong {
    background: var(--success);
    width: 100%;
}

/* Form sections */
.form-section {
    padding: 1.5rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

.form-section h3 {
    margin-top: 0;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

/* Select dropdown styling */
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 20 20'%3e%3cpath stroke='%236b7280' stroke-linecap='round' stroke-linejoin='round' stroke-width='1.5' d='M6 8l4 4 4-4'/%3e%3c/svg%3e");
    background-position: right 0.5rem center;
    background-repeat: no-repeat;
    background-size: 1.5em 1.5em;
    padding-right: 2.5rem;
}

select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Two column layout for names */
@media (max-width: 480px) {
    .form-group[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
    }
}

/* Phone input specific */
input[type="tel"] {
    font-family: monospace;
    letter-spacing: 0.5px;
}

/* Improved error states */
.form-group input:invalid:not(:placeholder-shown),
.form-group select:invalid:not(:placeholder-shown) {
    border-color: #ef4444;
}

.form-group input:valid:not(:placeholder-shown),
.form-group select:valid:not(:placeholder-shown) {
    border-color: #10b981;
}

/* Loading state */
.btn-submit.loading {
    position: relative;
    color: transparent;
}

.btn-submit.loading::after {
    content: "";
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.8s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}