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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.login-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    min-height: 80vh;
    display: flex;
    align-items: center;
}

.login-card {
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
    overflow: visible;
    animation: slideUp 0.6s ease-out;
    width: 100%;
    min-height: 600px;
    position: relative;
}

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

.login-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2.5rem 2rem 2rem;
    text-align: center;
    border-radius: 16px 16px 0 0;
}

.login-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
}

.login-header p {
    font-size: 1rem;
    opacity: 0.9;
    font-weight: 400;
}

/* Login Forms Container */
.login-forms {
    padding: 2rem;
    min-height: 400px;
}

.login-form {
    margin-bottom: 0;
}

.login-form.hidden {
    display: none;
}

/* Form Sections */
.form-section {
    margin-bottom: 2rem;
    padding: 1.5rem;
    border: 2px solid #f0f0f0;
    border-radius: 12px;
    transition: all 0.3s ease;
}

.form-section:hover {
    border-color: #e0e0e0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.form-section-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #f0f0f0;
}

.section-icon {
    color: #667eea;
    flex-shrink: 0;
}

.form-section-header h3 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin: 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    margin: 1.5rem 0;
    text-align: center;
}

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

.divider span {
    padding: 0 1rem;
    font-size: 0.875rem;
    color: #666;
    font-weight: 500;
}

/* Form Groups */
.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.9rem;
}

.form-group input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    height: 52px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Phone Input Group */
.phone-input-group {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    align-items: end;
}

.country-select-wrapper {
    position: relative;
    flex-shrink: 0;
}

.country-select {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    background: #f8f9fa;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.3s ease;
    white-space: nowrap;
    height: 52px;
    min-width: 120px;
}

.country-select:hover {
    border-color: #667eea;
    background: white;
}

.country-flag {
    font-size: 1.2rem;
}

.country-code {
    font-weight: 600;
    color: #333;
}

.dropdown-arrow {
    transition: transform 0.3s ease;
    margin-left: auto;
}

.country-select.active .dropdown-arrow {
    transform: rotate(180deg);
}

/* Country Dropdown */
.country-dropdown {
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    background: white;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    max-width: 350px;
    min-width: 280px;
}

.country-search {
    padding: 0.75rem;
    border-bottom: 1px solid #e9ecef;
}

.country-search input {
    width: 100%;
    padding: 0.5rem;
    border: 1px solid #e1e5e9;
    border-radius: 6px;
    font-size: 0.9rem;
    height: auto;
}

.country-list {
    max-height: 300px;
    overflow-y: auto;
}

.country-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    cursor: pointer;
    transition: background 0.2s ease;
}

.country-item:hover {
    background: #f8f9fa;
}

.country-item.selected {
    background: #e7f0ff;
}

.country-item-flag {
    font-size: 1.2rem;
    width: 24px;
}

.country-item-name {
    flex: 1;
    font-size: 0.9rem;
    color: #333;
}

.country-item-code {
    font-weight: 600;
    color: #6c757d;
    font-size: 0.9rem;
}

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

.phone-input-wrapper label {
    display: block;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 0.9rem;
}

.phone-input-wrapper input {
    width: 100%;
    padding: 1rem;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: #f8f9fa;
    height: 52px;
}

.phone-input-wrapper input:focus {
    outline: none;
    border-color: #667eea;
    background-color: white;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

/* Verification Code Input */
.code-input-wrapper {
    text-align: center;
}

.code-input-wrapper input {
    font-size: 2rem;
    text-align: center;
    letter-spacing: 0.5em;
    font-weight: 600;
    font-family: monospace;
    height: 80px;
}

.code-sent-info {
    text-align: center;
    color: #6c757d;
    font-size: 0.9rem;
    margin-top: 0.5rem;
}

/* Buttons */
.btn {
    width: 100%;
    padding: 1rem 1.5rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    margin-bottom: 1rem;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.btn-secondary {
    background: transparent;
    color: #6c757d;
    border: 2px solid #e1e5e9;
}

.btn-secondary:hover {
    background: #f8f9fa;
    border-color: #6c757d;
    color: #495057;
}

.btn-google {
    background: white;
    color: #3c4043;
    border: 2px solid #dadce0;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.btn-google:hover {
    background: #f8f9fa;
    border-color: #dadce0;
    box-shadow: 0 1px 3px rgba(60, 64, 67, 0.3);
    transform: translateY(-1px);
}

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

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

.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}

.btn-loading {
    display: none;
}

.btn.loading .btn-text {
    display: none;
}

.btn.loading .btn-loading {
    display: inline;
}

/* Form Info */
.form-info {
    text-align: center;
    color: #6c757d;
    font-size: 0.85rem;
}

/* Messages */
.login-message {
    margin: 0 2rem 2rem;
    padding: 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    text-align: center;
    display: none;
}

.login-message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    display: block;
}

.login-message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

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

/* Toast Notifications */
.toast {
    position: fixed;
    top: 20px;
    right: 20px;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    z-index: 2000;
    transform: translateX(400px);
    transition: transform 0.3s ease;
    max-width: 350px;
}

.toast.show {
    transform: translateX(0);
}

.toast.success {
    background-color: #28a745;
}

.toast.error {
    background-color: #dc3545;
}

/* Responsive Design */
@media (max-width: 600px) {
    body {
        padding: 0.5rem;
    }
    
    .login-container {
        min-height: 90vh;
    }
    
    .login-card {
        border-radius: 12px;
        min-height: 500px;
    }
    
    .login-header {
        padding: 2rem 1.5rem 1.5rem;
    }
    
    .login-header h1 {
        font-size: 1.75rem;
    }
    
    .login-forms {
        padding: 1.5rem;
    }
    
    .form-section {
        padding: 1rem;
    }
    
    .phone-input-group {
        flex-direction: column;
        gap: 1rem;
    }
    
    .country-select {
        width: 100%;
        justify-content: space-between;
    }
    
    .country-dropdown {
        max-width: none;
        left: 0;
        right: 0;
    }
}

/* Loading Animation */
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.btn.loading::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 20px;
    height: 20px;
    margin-left: -10px;
    margin-top: -10px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

/* Scrollbar styling for country list */
.country-list::-webkit-scrollbar {
    width: 6px;
}

.country-list::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.country-list::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.country-list::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Login Footer */
.login-footer {
    text-align: center;
    padding: 1rem 2rem 2rem;
    margin-top: auto;
}

.login-footer a {
    color: #6b7280;
    font-size: 0.875rem;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-footer a:hover {
    color: #667eea;
    text-decoration: underline;
}