/* Reset & Base Styles */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 50%, #f1f5f9 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    color: #1f2937;
    position: relative;
    overflow-x: hidden;
}

/* Subtle pattern overlay */
body::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%231e3a5f' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
    pointer-events: none;
}

/* Container */
.auth-container {
    width: 100%;
    padding: 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: #ffffff;
    width: 100%;
    max-width: 480px;
    padding: 48px;
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    border: 1px solid #e5e7eb;
    animation: slideUp 0.5s ease-out;
}

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

/* Header */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.logo-container {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 16px;
}

.logo-icon {
    height: 36px;
    width: auto;
}

.logo-text {
    font-size: 28px;
    font-weight: 700;
    color: #0d9488;
    letter-spacing: -0.025em;
}

#header-subtitle {
    font-size: 15px;
    color: #6b7280;
    font-weight: 400;
    line-height: 1.5;
}

/* Form Styles */
.auth-form {
    display: none;
    flex-direction: column;
    gap: 20px;
}

.auth-form.active {
    display: flex;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.01em;
}

.form-group input, .form-group select {
    padding: 14px 16px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    color: #111827;
    outline: none;
    transition: all 0.2s ease;
    background: #f9fafb;
}

.form-group input::placeholder {
    color: #9ca3af;
}

.form-group input:focus, .form-group select:focus {
    border-color: #0d9488;
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.1);
    background: white;
}

.form-group input:hover:not(:focus) {
    border-color: #d1d5db;
}

.form-actions {
    display: flex;
    justify-content: flex-end;
    margin-bottom: 4px;
}

.forgot-password {
    font-size: 14px;
    color: #6b7280;
    text-decoration: none;
    transition: color 0.2s;
}

.forgot-password:hover {
    color: #0d9488;
    text-decoration: underline;
}

/* Role Selector */
.role-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-top: 4px;
}

.role-option {
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #f9fafb;
}

.role-option:hover {
    border-color: #0d9488;
    background: #f0fdfa;
    transform: translateY(-2px);
}

.role-option.active {
    background: linear-gradient(135deg, #ccfbf1, #99f6e4);
    border-color: #0d9488;
    color: #0f766e;
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.2);
}

.role-option:nth-child(2).active {
    background: linear-gradient(135deg, #e0f2fe, #bae6fd);
    border-color: #0284c7;
    color: #0369a1;
    box-shadow: 0 4px 6px -1px rgba(2, 132, 199, 0.2);
}

.role-icon {
    font-size: 1.5rem;
    margin-bottom: 6px;
}

.role-label {
    font-size: 14px;
    font-weight: 600;
}

/* Hidden elements utility */
.hidden {
    display: none !important;
}

/* Health Worker Section Specifics */
#health-worker-fields {
    background: linear-gradient(135deg, #e0f2fe, #f0f9ff);
    padding: 20px;
    border-radius: 12px;
    border: 1px solid #bae6fd;
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-top: 8px;
    animation: slideDown 0.3s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

#health-worker-fields label {
    color: #0369a1;
    font-weight: 600;
    font-size: 14px;
}

#health-worker-fields input, 
#health-worker-fields select {
    border-color: #7dd3fc;
    background: white;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
}

#health-worker-fields input:focus, 
#health-worker-fields select:focus {
    border-color: #0284c7;
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.15);
}

/* Primary Button */
.submit-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #0d9488, #0f766e);
    color: white;
    font-weight: 600;
    font-size: 16px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 6px -1px rgba(13, 148, 136, 0.3);
    margin-top: 8px;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #0f766e, #115e59);
    transform: translateY(-2px);
    box-shadow: 0 10px 15px -3px rgba(13, 148, 136, 0.4);
}

.submit-btn:active {
    transform: translateY(0);
}

/* Social Authentication */
.social-auth {
    margin-top: 24px;
}

.divider {
    display: flex;
    align-items: center;
    margin: 24px 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e5e7eb;
}

.divider span {
    padding: 0 16px;
    font-size: 13px;
    font-weight: 500;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.social-btn {
    width: 100%;
    padding: 14px 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    cursor: pointer;
    transition: all 0.2s ease;
    margin-bottom: 14px;
}

.social-btn:last-child {
    margin-bottom: 0;
}

.social-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
}

.social-btn:active {
    transform: translateY(0);
}

.social-icon {
    flex-shrink: 0;
}

/* Loading spinner for social buttons */
.btn-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(0, 0, 0, 0.1);
    border-top-color: #0d9488;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-right: 8px;
}

.social-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    pointer-events: none;
}

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

/* Footer */
.auth-footer {
    margin-top: 28px;
    text-align: center;
    padding-top: 24px;
    border-top: 1px solid #e5e7eb;
}

.auth-footer p {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 8px;
}

.auth-footer a {
    font-size: 14px;
    color: #0d9488;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-footer a:hover {
    color: #0f766e;
    text-decoration: underline;
}

.guest-link {
    display: inline-block;
    margin-top: 12px;
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s;
}

.guest-link:hover {
    color: #6b7280;
}

/* Responsive */
@media (max-width: 520px) {
    .auth-card {
        padding: 32px 24px;
        margin: 16px;
        max-width: calc(100% - 32px);
    }
    
    .logo-text {
        font-size: 24px;
    }
    
    .form-group input {
        padding: 12px 14px;
    }
    
    .submit-btn,
    .social-btn {
        padding: 12px 16px;
    }
}
