/* Registration Styles - GitHub-inspired, Mobile Optimized */

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

:root {
    --color-primary: #0969da;
    --color-primary-dark: #0860c7;
    --color-success: #1a7f37;
    --color-danger: #cf222e;
    --color-text: #24292f;
    --color-text-secondary: #57606a;
    --color-text-muted: #8b949e;
    --color-border: #d0d7de;
    --color-border-light: #eaeef2;
    --color-bg: #ffffff;
    --color-bg-secondary: #f6f8fa;
    --shadow-sm: 0 1px 0 rgba(31,35,40,0.04);
    --shadow-md: 0 3px 10px rgba(31,35,40,0.1);
    --radius-sm: 6px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --google-blue: #4285F4;
    --google-green: #34A853;
    --google-yellow: #FBBC05;
    --google-red: #EA4335;
    --whatsapp-green: #25D366;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Noto Sans', Helvetica, Arial, sans-serif;
    color: var(--color-text);
    line-height: 1.5;
    background: var(--color-bg);
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
}

.container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* Header */
.header {
    padding: 16px 32px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.header a {
    display: flex;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: var(--color-text);
    font-weight: 600;
    font-size: 20px;
}

.header svg {
    width: 32px;
    height: 32px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 32px 16px 64px;
}

.auth-container {
    width: 100%;
    max-width: 308px;
}

.auth-box {
    text-align: center;
}

.auth-header {
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 8px;
}

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

/* Registration Options */
.registration-options {
    margin-bottom: 24px;
}

.registration-options .btn-google,
.registration-options .btn-phone {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 500;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 44px;
}

.registration-options .btn-google:hover,
.registration-options .btn-phone:hover {
    background: var(--color-bg-secondary);
    border-color: var(--color-border);
    box-shadow: var(--shadow-sm);
}

.registration-options .btn-google {
    border-color: var(--color-border);
    background: #fff;
}

.registration-options .btn-google svg {
    flex-shrink: 0;
}

.registration-options .btn-phone {
    background: var(--color-bg);
    color: var(--color-text);
}

.registration-options .btn-phone svg {
    color: var(--whatsapp-green);
    flex-shrink: 0;
}

.registration-options .btn-phone:hover {
    background: var(--color-bg-secondary);
    border-color: var(--whatsapp-green);
}

.divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: var(--color-text-muted);
    font-size: 12px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--color-border-light);
}

.divider span {
    padding: 0 12px;
}

/* Form */
.auth-form {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 16px;
    text-align: left;
}

.step-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--color-text);
    margin-bottom: 16px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--color-border-light);
}

.form-group {
    margin-bottom: 16px;
}

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

.form-group input,
.form-group select {
    width: 100%;
    padding: 5px 12px;
    font-size: 14px;
    line-height: 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background-color: var(--color-bg);
    color: var(--color-text);
    transition: border-color 0.2s, box-shadow 0.2s;
    min-height: 32px;
}

.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.3);
}

.form-group input::placeholder {
    color: var(--color-text-muted);
}

.form-group .input-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: var(--color-text-secondary);
}

/* Phone Input Group */
.phone-input-group {
    display: flex;
    gap: 4px;
}

.phone-input-group select {
    width: 90px;
    padding: 5px 8px;
    font-size: 14px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    cursor: pointer;
}

.phone-input-group input {
    flex: 1;
}

/* OTP Section */
.otp-section {
    display: none;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.otp-section.show {
    display: block;
}

.otp-label {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 12px;
}

.otp-inputs {
    display: flex;
    gap: 6px;
    justify-content: center;
    margin-bottom: 16px;
}

.otp-input {
    width: 40px;
    height: 44px;
    text-align: center;
    font-size: 20px;
    font-weight: 600;
    border: 2px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-bg);
    color: var(--color-text);
    transition: all 0.2s ease;
}

.otp-input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(9, 105, 218, 0.2);
}

.otp-input.verified {
    border-color: var(--color-success);
    background: rgba(26, 127, 55, 0.05);
    color: var(--color-success);
}

.otp-actions {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.otp-actions .btn-link {
    background: none;
    border: none;
    color: var(--color-primary);
    font-size: 13px;
    cursor: pointer;
    padding: 0;
    text-decoration: none;
}

.otp-actions .btn-link:hover {
    text-decoration: underline;
}

.otp-timer {
    font-size: 12px;
    color: var(--color-text-muted);
    text-align: center;
}

.otp-timer.expired {
    color: var(--color-danger);
}

/* Send OTP Button */
.send-otp-btn {
    margin-top: 8px;
    padding: 6px 12px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-primary);
    background: transparent;
    border: 1px solid var(--color-primary);
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 28px;
}

.send-otp-btn:hover {
    background: rgba(9, 105, 218, 0.05);
}

.send-otp-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.send-otp-btn.sent {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
}

/* Button */
.btn {
    display: block;
    width: 100%;
    padding: 5px 16px;
    font-size: 14px;
    font-weight: 500;
    line-height: 20px;
    border: 1px solid;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: 0.2s;
    text-decoration: none;
    text-align: center;
    min-height: 32px;
}

.btn-primary {
    background-color: #1a7f37;
    border-color: rgba(27, 31, 35, 0.15);
    color: #ffffff;
}

.btn-primary:hover {
    background-color: #166b29;
}

.btn-primary:active {
    background-color: #145c23;
}

.btn-primary:disabled {
    background-color: #94d3a2;
    cursor: not-allowed;
}

.btn-block {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 8px 16px;
    font-size: 14px;
    min-height: 36px;
    margin-top: 12px;
}

.btn-block:first-child {
    margin-top: 0;
}

/* Form Footer */
.form-footer {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}

.form-footer p {
    font-size: 12px;
    color: var(--color-text-secondary);
    line-height: 1.6;
}

.form-footer a {
    color: var(--color-primary);
    text-decoration: none;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Footer */
.footer {
    padding: 24px 32px;
    text-align: center;
    border-top: 1px solid var(--color-border-light);
    margin-top: auto;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    margin-bottom: 12px;
}

.footer-links a {
    font-size: 12px;
    color: var(--color-text-secondary);
    text-decoration: none;
}

.footer-links a:hover {
    color: var(--color-primary);
    text-decoration: underline;
}

.footer p {
    font-size: 12px;
    color: var(--color-text-muted);
}

/* Error Message */
.error-message {
    color: var(--color-danger);
    font-size: 12px;
    margin-top: 8px;
    display: none;
}

.error-message.show {
    display: block;
}

/* Success Message */
.success-message {
    display: none;
    text-align: center;
    padding: 32px 16px;
}

.success-message.show {
    display: block;
}

.success-message .success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 16px;
    background: var(--color-success);
    color: white;
    font-size: 32px;
    font-weight: bold;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.success-message h2 {
    font-size: 24px;
    font-weight: 600;
    color: var(--color-success);
    margin-bottom: 8px;
}

.success-message p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

.success-message .redirect-msg {
    margin-top: 12px;
    font-size: 13px;
    color: var(--color-text-muted);
}

/* Toast Notifications */
.error-toast,
.success-toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 24px;
    border-radius: var(--radius-md);
    font-size: 14px;
    font-weight: 500;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
    max-width: 90%;
    word-wrap: break-word;
}

.error-toast {
    background: var(--color-danger);
    color: white;
}

.success-toast {
    background: var(--color-success);
    color: white;
}

.error-toast.show,
.success-toast.show {
    opacity: 1;
    visibility: visible;
    bottom: 40px;
}

/* Spinner */
.spinner {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

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

/* Mobile Optimizations */
@media (max-width: 480px) {
    .header {
        padding: 12px 16px;
    }
    
    .main-content {
        padding: 16px 12px 32px;
    }
    
    .auth-container {
        max-width: 100%;
    }
    
    .auth-header h1 {
        font-size: 20px;
    }
    
    .auth-header p {
        font-size: 13px;
    }
    
    .registration-options .btn-google,
    .registration-options .btn-phone {
        font-size: 14px;
        padding: 14px 16px;
        min-height: 48px;
    }
    
    .auth-form {
        padding: 12px;
    }
    
    .form-group {
        margin-bottom: 12px;
    }
    
    .form-group label {
        font-size: 13px;
    }
    
    .form-group input,
    .form-group select,
    .phone-input-group select {
        font-size: 16px;
        min-height: 36px;
    }
    
    .otp-input {
        width: 36px;
        height: 40px;
        font-size: 18px;
    }
    
    .otp-inputs {
        gap: 4px;
    }
    
    .btn-block {
        font-size: 14px;
        padding: 12px 16px;
        min-height: 44px;
    }
    
    .form-footer {
        margin-top: 12px;
        padding-top: 12px;
    }
    
    .form-footer p {
        font-size: 11px;
    }
    
    .footer {
        padding: 16px 12px;
    }
    
    .footer-links {
        gap: 12px 16px;
    }
    
    .footer-links a,
    .footer p {
        font-size: 11px;
    }
}

/* Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .auth-container {
        max-width: 380px;
    }
    
    .auth-form {
        padding: 20px;
    }
}

/* Desktop */
@media (min-width: 769px) {
    .main-content {
        padding: 64px 32px;
    }
    
    .auth-container {
        max-width: 308px;
    }
}

/* Touch optimization */
@media (hover: none) and (pointer: coarse) {
    .btn:hover {
        background-color: inherit;
    }
    
    .registration-options .btn-google:hover,
    .registration-options .btn-phone:hover {
        background: var(--color-bg);
    }
}

/* WhatsApp-specific styles */
.registration-options .btn-phone.whatsapp {
    border-color: var(--whatsapp-green);
    color: #128C7E;
}

.registration-options .btn-phone.whatsapp:hover {
    background: rgba(37, 211, 102, 0.1);
}

.registration-options .btn-phone.whatsapp svg {
    color: var(--whatsapp-green);
}

/* Verified state */
.phone-verified .btn-phone {
    background: var(--color-success);
    border-color: var(--color-success);
    color: white;
    pointer-events: none;
}

.phone-verified .btn-phone svg {
    color: white;
}

/* Disabled state */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.otp-input:disabled {
    background: var(--color-bg-secondary);
    color: var(--color-text-muted);
}

/* Modal Styles */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: var(--color-bg);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 400px;
    width: 90%;
    position: relative;
    animation: slideUp 0.3s ease;
}

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

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

.modal-content .close {
    cursor: pointer;
    color: var(--color-text-muted);
    font-size: 24px;
    line-height: 1;
}

.modal-content .close:hover {
    color: var(--color-text);
}

.modal-content h2 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 8px;
}

.modal-content p {
    font-size: 14px;
    color: var(--color-text-secondary);
}

