:root {
    --primary-color: #2196F3;
    --primary-dark: #1976D2;
    --text-color: #333;
    --text-light: #666;
    --background-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #eee;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
    --transition-base: all 0.3s ease;
    --success-color: #4CAF50;
    --error-color: #f44336;
    --navbar-height: 64px;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: var(--white);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: var(--navbar-height);
}

.navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--navbar-height);
    background: var(--white);
    border-bottom: 1px solid var(--border-color);
    z-index: 1000;
}

.nav-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    height: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-size: 1.5rem;
    font-weight: 700;
}

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

.nav-signin {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
}

.page-container {
    min-height: calc(100vh - var(--navbar-height));
    display: flex;
    flex-direction: column;
}

.main-content {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.content-wrapper {
    width: 100%;
    max-width: 480px;
}

h1 {
    font-size: 1.5rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 0.5rem;
}

.subtitle {
    color: var(--text-light);
    text-align: center;
    margin-bottom: 2rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: var(--text-color);
    font-weight: 500;
}

.form-input {
    width: 100%;
    padding: 0.75rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    font-size: 1rem;
    transition: var(--transition-base);
    background: var(--white);
}

.form-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.form-input.valid {
    border-color: var(--success-color);
}

.form-input.invalid {
    border-color: var(--error-color);
}

.phone-input-container {
    display: flex;
    gap: 0.5rem;
}

.phone-code-select {
    width: 140px;
    padding: 0.75rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
    font-size: 1rem;
}

.verification-code-container {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin: 2rem 0;
}

.code-input {
    width: 50px;
    height: 60px;
    text-align: center;
    font-size: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    transition: var(--transition-base);
}

.code-input:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(33, 150, 243, 0.1);
}

.code-input.error {
    border-color: var(--error-color);
    animation: shake 0.5s;
}

.password-input-container {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
}

.password-criteria {
    margin-top: 1rem;
    padding: 1rem;
    background: var(--background-light);
    border-radius: var(--border-radius);
}

.password-criteria h4 {
    font-size: 0.9rem;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.password-criteria ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.password-criteria li {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 0.25rem;
}

.password-criteria li i {
    font-size: 1rem;
}

.password-criteria li i.fa-times-circle {
    color: var(--error-color);
}

.password-criteria li i.fa-check-circle {
    color: var(--success-color);
}

.password-match-message {
    margin-top: 0.5rem;
    color: var(--error-color);
    font-size: 0.9rem;
}

.fixed-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--white);
    border-top: 1px solid var(--border-color);
    z-index: 100;
}

.footer-content {
    max-width: 480px;
    margin: 0 auto;
    padding: 1.5rem 20px;
    display: flex;
    gap: 1rem;
}

.back-btn {
    padding: 1rem;
    background: var(--background-light);
    color: var(--text-color);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.continue-btn {
    flex: 1;
    padding: 1rem;
    background: var(--primary-color);
    color: var(--white);
    border: none;
    border-radius: var(--border-radius);
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition-base);
}

.continue-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.continue-btn:not(:disabled):hover {
    background: var(--primary-dark);
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
}

.toast {
    padding: 1rem;
    margin-bottom: 0.5rem;
    border-radius: var(--border-radius);
    background: white;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    animation: slideIn 0.3s ease;
}

.toast.success {
    border-left: 4px solid var(--success-color);
}

.toast.error {
    border-left: 4px solid var(--error-color);
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-light);
    cursor: pointer;
    padding: 0.25rem;
}

.hidden {
    display: none !important;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 20px 20px 160px;
    }

    .verification-code-container {
        gap: 0.25rem;
    }

    .code-input {
        width: 45px;
        height: 55px;
        font-size: 1.25rem;
    }

    .fixed-footer {
        background: var(--white);
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    }
}

@supports (-webkit-touch-callout: none) {
    .main-content {
        padding-bottom: calc(160px + env(safe-area-inset-bottom));
    }
    
    .fixed-footer {
        padding-bottom: env(safe-area-inset-bottom);
    }
}