@import url('https://fonts.googleapis.com/css2?family=Grandstander:wght@400;600;700&family=Figtree:wght@400;500;600&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Figtree', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 16px;
    overflow-y: auto;
}

#root {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.auth-container {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    width: 100%;
    padding: 32px;
    margin: auto 0;
}

@media (max-width: 480px) {
    .auth-container {
        padding: 24px;
        border-radius: 12px;
    }
}

@media (max-height: 800px) {
    .auth-container {
        padding: 20px;
        margin: 0;
    }
    
    body {
        padding: 10px;
    }
    
    .logo {
        max-width: 160px;
        margin-bottom: 10px;
    }
    
    .auth-header {
        margin-bottom: 16px;
    }
    
    .form-group {
        margin-bottom: 10px;
    }
    
    .tab-buttons {
        margin-bottom: 16px;
    }
}

.auth-header {
    text-align: center;
    margin-bottom: 20px;
}

.auth-header h1 {
    font-family: 'Grandstander', cursive;
    color: #ed4c4c;
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 8px;
}

.auth-header p {
    color: #333;
    font-size: 14px;
}

.logo {
    max-width: 180px;
    height: auto;
    margin: 0 auto 12px;
    display: block;
}

@media (max-width: 480px) {
    .logo {
        max-width: 160px;
    }
    
    .auth-header p {
        font-size: 13px;
    }
}

.tab-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    background: #f5f5f5;
    padding: 4px;
    border-radius: 8px;
}

.tab-button {
    flex: 1;
    padding: 12px;
    border: none;
    background: transparent;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    transition: all 0.3s;
}

@media (max-width: 480px) {
    .tab-button {
        padding: 10px;
        font-size: 13px;
    }
}

.tab-button.active {
    background: #ffffff;
    color: #ed4c4c;
    box-shadow: 0 2px 8px rgba(237, 76, 76, 0.2);
}

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

.form-group label {
    display: block;
    margin-bottom: 6px;
    color: #000;
    font-size: 13px;
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    color: #000;
    transition: border-color 0.3s;
}

@media (max-width: 480px) {
    .form-group input {
        font-size: 16px;
    }
}

.form-group input:focus {
    outline: none;
    border-color: #ed4c4c;
}

.submit-button {
    width: 100%;
    padding: 12px;
    background: #ed4c4c;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 4px;
}

.submit-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(237, 76, 76, 0.4);
}

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

.divider {
    display: flex;
    align-items: center;
    margin: 16px 0;
    color: #666;
    font-size: 13px;
}

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

.divider::before {
    margin-right: 12px;
}

.divider::after {
    margin-left: 12px;
}

.social-buttons {
    display: flex;
    gap: 12px;
}

.social-button {
    flex: 1;
    padding: 10px;
    border: 2px solid #e0e0e0;
    background: #ffffff;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #333;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.social-icon {
    width: 16px;
    height: 16px;
}

@media (max-width: 480px) {
    .social-button {
        padding: 10px;
        font-size: 13px;
    }
    
    .social-icon {
        width: 16px;
        height: 16px;
    }
}

.social-button:hover {
    border-color: #ed4c4c;
    color: #ed4c4c;
    background: #f5f5f5;
}

.success-message {
    background: #ed4c4c;
    color: #ffffff;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    text-align: center;
    font-weight: 500;
    font-size: 14px;
}

.footer {
    text-align: center;
    margin-top: 16px;
    color: #666;
    font-size: 13px;
    flex-shrink: 0;
}

@media (max-width: 480px) {
    .footer {
        font-size: 12px;
        margin-top: 12px;
    }
}

@media (max-height: 800px) {
    .footer {
        margin-top: 12px;
    }
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 12px;
}

.checkbox-group input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

.checkbox-group label {
    font-size: 12px;
    color: #333;
    line-height: 1.4;
    cursor: pointer;
}

.terms-link {
    color: #ed4c4c;
    text-decoration: none;
}

.terms-link:hover {
    text-decoration: underline;
}

@media (max-height: 800px) {
    .checkbox-group {
        margin-bottom: 10px;
    }
    
    .checkbox-group label {
        font-size: 11px;
    }
}

.phone-auth-header {
    margin-bottom: 20px;
}

.phone-auth-header h3 {
    font-size: 18px;
    color: #000;
    margin-top: 12px;
    text-align: center;
}

.back-button {
    background: none;
    border: none;
    color: #ed4c4c;
    font-size: 14px;
    cursor: pointer;
    padding: 8px 0;
    font-weight: 500;
    transition: opacity 0.2s;
}

.back-button:hover {
    opacity: 0.7;
}

.code-hint {
    font-size: 12px;
    color: #666;
    margin-top: 8px;
}

@media (max-height: 800px) {
    .phone-auth-header h3 {
        font-size: 16px;
        margin-top: 8px;
    }
}


.logo {
    max-width: 150px;
    height: auto;
    margin: 0 auto 12px;
    display: block;
}

/* Dark Mode Support */
@media (prefers-color-scheme: dark) {
    body {
        background: #1a1a1a;
    }

    .auth-container {
        background: #2d2d2d;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
    }

    .auth-header p {
        color: #e0e0e0;
    }

    .tab-buttons {
        background: #1a1a1a;
    }

    .tab-button {
        color: #e0e0e0;
    }

    .tab-button.active {
        background: #3d3d3d;
        color: #ed4c4c;
    }

    .form-group label {
        color: #ffffff;
    }

    .form-group input {
        background: #3d3d3d;
        border-color: #4d4d4d;
        color: #ffffff;
    }

    .form-group input:focus {
        border-color: #ed4c4c;
        background: #3d3d3d;
    }

    .divider {
        color: #999;
    }

    .divider::before,
    .divider::after {
        background: #4d4d4d;
    }

    .social-button {
        background: #3d3d3d;
        border-color: #4d4d4d;
        color: #e0e0e0;
    }

    .social-button:hover {
        background: #4d4d4d;
        border-color: #ed4c4c;
        color: #ed4c4c;
    }

    .checkbox-group label {
        color: #e0e0e0;
    }

    .footer {
        color: #999;
    }

    .error-details {
        background: #2d1a1a !important;
        border-color: #4d2d2d !important;
    }

    .error-details p,
    .error-details ul,
    .error-details li {
        color: #ccc !important;
    }

    /* Hide black logo in dark mode, show white logo */
    .logo-black {
        opacity: 0;
    }

    .logo-white {
        opacity: 1;
    }
}

/* Manual light mode toggle - override system preference */
body.light-mode {
    background: #ffffff !important;
}

body.light-mode .auth-container {
    background: #ffffff !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08) !important;
}

body.light-mode .auth-header p {
    color: #333 !important;
}

body.light-mode .tab-buttons {
    background: #f5f5f5 !important;
}

body.light-mode .tab-button {
    color: #333 !important;
}

body.light-mode .tab-button.active {
    background: #ffffff !important;
    color: #ed4c4c !important;
    box-shadow: 0 2px 8px rgba(237, 76, 76, 0.2) !important;
}

body.light-mode .form-group label {
    color: #000 !important;
}

body.light-mode .form-group input {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    color: #000 !important;
}

body.light-mode .divider {
    color: #666 !important;
}

body.light-mode .divider::before,
body.light-mode .divider::after {
    background: #e0e0e0 !important;
}

body.light-mode .social-button {
    background: #ffffff !important;
    border-color: #e0e0e0 !important;
    color: #333 !important;
}

body.light-mode .checkbox-group label {
    color: #333 !important;
}

body.light-mode .footer {
    color: #666 !important;
}

body.light-mode .theme-toggle {
    border-color: #e0e0e0 !important;
    color: #333 !important;
}

/* Manual dark mode toggle */
body.dark-mode {
    background: #1a1a1a !important;
}

body.dark-mode .auth-container {
    background: #2d2d2d !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode .logo-black {
    opacity: 0 !important;
}

body.dark-mode .logo-white {
    opacity: 1 !important;
}

body.dark-mode .auth-header p,
body.dark-mode .tab-button,
body.dark-mode .form-group label,
body.dark-mode .checkbox-group label {
    color: #e0e0e0 !important;
}

body.dark-mode .tab-buttons {
    background: #1a1a1a !important;
}

body.dark-mode .tab-button.active {
    background: #3d3d3d !important;
}

body.dark-mode .form-group input {
    background: #3d3d3d !important;
    border-color: #4d4d4d !important;
    color: #ffffff !important;
}

body.dark-mode .social-button {
    background: #3d3d3d !important;
    border-color: #4d4d4d !important;
    color: #e0e0e0 !important;
}

body.dark-mode .divider {
    color: #999 !important;
}

body.dark-mode .divider::before,
body.dark-mode .divider::after {
    background: #4d4d4d !important;
}

body.dark-mode .footer {
    color: #999 !important;
}

/* Dark mode toggle button */
.theme-toggle {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: transparent;
    border: 2px solid #e0e0e0;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    z-index: 9999 !important;
    color: #333;
}

.theme-toggle svg {
    transition: transform 0.3s;
}

.theme-toggle:hover {
    border-color: #ed4c4c;
    background: rgba(237, 76, 76, 0.05);
}

.theme-toggle:hover svg {
    transform: rotate(20deg);
}

body.dark-mode .theme-toggle {
    border-color: #4d4d4d;
    color: #e0e0e0;
}

body.dark-mode .theme-toggle:hover {
    background: rgba(237, 76, 76, 0.1);
}

@media (max-width: 480px) {
    .theme-toggle {
        width: 40px;
        height: 40px;
        font-size: 20px;
        top: 16px;
        left: 16px;
    }
}
