/* Mobile-First Auth Styles */
:root {
    --primary-color: #FFB526;
    --primary-hover: #e5a322;
    --text-dark: #111827;
    --text-medium: #4B5563;
    --text-light: #9CA3AF;
    --bg-light: #F9FAFB;
    --border-color: #E5E7EB;
    --success-color: #10B981;
    --error-color: #EF4444;
}

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

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow: hidden; /* Prevent scrolling */
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff;
}

.mobile-auth-container {
    display: flex;
    flex-direction: column;
    height: 100vh; /* Fallback */
    height: 100dvh; /* Dynamic Viewport Height */
    width: 100vw;
    position: relative;
    overflow: hidden;
}

/* Progress Bar */
.progress-container {
    padding: 16px 20px 0;
    flex-shrink: 0;
}

.progress-bar-bg {
    height: 4px;
    background-color: #F3F4F6;
    border-radius: 2px;
    width: 100%;
    overflow: hidden;
}

.progress-bar-fill {
    height: 100%;
    background-color: var(--primary-color);
    border-radius: 2px;
    width: 25%; /* Initial width */
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Slide Container */
.slides-viewport {
    flex: 1;
    position: relative;
    width: 100%;
    overflow: hidden;
}

.slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
    opacity: 0;
    pointer-events: none;
    background-color: #fff;
}

.slide.active {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
}

.slide.prev {
    transform: translateX(-20%);
    opacity: 0;
}

/* Typography */
h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--text-dark);
    margin: 0 0 8px 0;
    line-height: 1.3;
}

p.subtitle {
    font-size: 15px;
    color: var(--text-medium);
    margin: 0 0 32px 0;
    line-height: 1.5;
}

/* Form Elements */
.form-group {
    margin-bottom: 24px;
}

.label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-field {
    width: 100%;
    padding: 16px;
    font-size: 18px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    background-color: #fff;
    color: var(--text-dark);
    font-weight: 500;
}

.input-field:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 4px rgba(255, 181, 38, 0.1);
}

.input-field::placeholder {
    color: var(--text-light);
}

.input-prefix {
    position: absolute;
    left: 16px;
    font-size: 18px;
    font-weight: 500;
    color: var(--text-dark);
    pointer-events: none;
}

.input-with-prefix {
    padding-left: 64px;
}

/* OTP Input */
.otp-container {
    display: flex;
    gap: 12px;
    justify-content: center;
    margin-bottom: 24px;
}

.otp-digit {
    width: 48px;
    height: 56px;
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    outline: none;
    transition: all 0.2s ease;
    background-color: #fff;
    color: var(--text-dark);
    padding: 0;
}

.otp-digit:focus {
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.05);
}

/* Role Selection Cards */
.role-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
}

.role-card {
    border: 2px solid var(--border-color);
    border-radius: 16px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #fff;
    position: relative;
    overflow: hidden;
}

.role-card.selected {
    border-color: var(--primary-color);
    background-color: rgba(255, 181, 38, 0.05);
}

.role-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background-color: #F3F4F6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
    transition: all 0.2s ease;
}

.role-card.selected .role-icon {
    background-color: var(--primary-color);
    color: #fff;
}

.role-info h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 0 0 4px 0;
    color: var(--text-dark);
}

.role-info p {
    font-size: 13px;
    color: var(--text-medium);
    margin: 0;
    line-height: 1.4;
}

.check-circle {
    width: 20px;
    height: 20px;
    border: 2px solid var(--border-color);
    border-radius: 50%;
    margin-left: auto;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.role-card.selected .check-circle {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
}

.check-circle svg {
    width: 12px;
    height: 12px;
    color: #fff;
    opacity: 0;
    transition: opacity 0.2s ease;
}

.role-card.selected .check-circle svg {
    opacity: 1;
}

/* Bottom Action Bar */
.action-bar {
    padding: 16px 20px;
    background-color: #fff;
    border-top: 1px solid #F3F4F6;
    display: flex;
    flex-direction: column;
    gap: 12px;
    position: relative;
    z-index: 10;
    /* Safe area for iPhone X+ */
    padding-bottom: max(16px, env(safe-area-inset-bottom));
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background-color: var(--primary-color);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    background-color: #E5E7EB;
    color: #9CA3AF;
    cursor: not-allowed;
    transform: none;
}

.btn-text {
    background: none;
    border: none;
    color: var(--text-medium);
    font-size: 14px;
    font-weight: 500;
    padding: 8px;
    cursor: pointer;
}

/* Alerts */
.alert-toast {
    position: absolute;
    top: 20px;
    left: 20px;
    right: 20px;
    padding: 12px 16px;
    border-radius: 10px;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    display: flex;
    align-items: center;
    gap: 12px;
    z-index: 100;
    transform: translateY(-100px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-left: 4px solid var(--primary-color);
}

.alert-toast.show {
    transform: translateY(0);
}

.alert-toast.error {
    border-left-color: var(--error-color);
}

.alert-toast.success {
    border-left-color: var(--success-color);
}

.alert-icon {
    font-size: 20px;
}

.alert-message {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-dark);
}

/* Loading Overlay */
.loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 50;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.loading-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #F3F4F6;
    border-top-color: var(--primary-color);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Helper Classes */
.text-center { text-align: center; }
.mb-4 { margin-bottom: 16px; }
.mt-2 { margin-top: 8px; }
.text-sm { font-size: 14px; }
.text-primary { color: var(--primary-color); }
.font-medium { font-weight: 500; }
