/* Facebook-inspired styles for YHB Marina System */

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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    position: relative;
    color: #333;
}

/* Background image overlay */
.background-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 1 1"><rect width="1" height="1" fill="none"/></svg>');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.1;
    z-index: -1;
}

/* Main container */
.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    padding: 20px;
}

/* Login card */
.login-card {
    background: white;
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    animation: fadeInUp 0.6s ease-out;
}

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

/* Logo section */
.logo-section {
    text-align: center;
    margin-bottom: 30px;
}

.logo-section h1 {
    color: #1877f2;
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 8px;
    line-height: 1.2;
}

.subtitle {
    color: #65676b;
    font-size: 16px;
    font-weight: 400;
}

.logout-message {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
    border-radius: 6px;
    padding: 12px 16px;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
}

/* Step containers */
.step-container {
    display: none;
}

.step-container.active {
    display: block;
    animation: slideIn 0.4s ease-out;
}

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

.step-container h2 {
    color: #1c1e21;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    text-align: center;
}

.step-description {
    color: #65676b;
    font-size: 15px;
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.4;
}

/* Button groups */
.button-group {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

/* Login buttons */
.login-btn {
    background: white;
    border: 2px solid #dddfe2;
    border-radius: 8px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: left;
    width: 100%;
    position: relative;
    overflow: hidden;
}

.login-btn:hover {
    border-color: #1877f2;
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.15);
    transform: translateY(-1px);
}

.login-btn.primary:hover {
    background: linear-gradient(135deg, #1877f2 0%, #42a5f5 100%);
    color: white;
    border-color: #1877f2;
}

.login-btn.secondary:hover {
    background: linear-gradient(135deg, #42a5f5 0%, #1877f2 100%);
    color: white;
    border-color: #42a5f5;
}

.btn-icon {
    font-size: 24px;
    display: block;
    margin-bottom: 8px;
}

.btn-text {
    font-size: 18px;
    font-weight: 600;
    display: block;
    margin-bottom: 4px;
}

.btn-desc {
    font-size: 14px;
    color: #65676b;
    display: block;
}

.login-btn:hover .btn-desc {
    color: rgba(255, 255, 255, 0.9);
}

/* Form elements */
.input-group {
    margin-bottom: 20px;
}

.input-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1c1e21;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #dddfe2;
    border-radius: 6px;
    font-size: 16px;
    background: #f5f6f7;
    transition: all 0.2s ease;
}

.form-input:focus {
    outline: none;
    border-color: #1877f2;
    background: white;
    box-shadow: 0 0 0 2px rgba(24, 119, 242, 0.2);
}

.otp-input {
    text-align: center;
    font-size: 24px;
    font-weight: 600;
    letter-spacing: 8px;
    transition: all 0.2s ease;
}

.otp-input.success {
    border-color: #28a745;
    background: #f8fff8;
    box-shadow: 0 0 0 2px rgba(40, 167, 69, 0.2);
}

.otp-input.error {
    border-color: #dc3545;
    background: #fff5f5;
    animation: shake 0.5s ease-in-out;
}

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

/* Buttons */
.submit-btn {
    width: 100%;
    background: linear-gradient(135deg, #1877f2 0%, #42a5f5 100%);
    color: white;
    border: none;
    border-radius: 6px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
}

.submit-btn:hover {
    background: linear-gradient(135deg, #166fe5 0%, #1877f2 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(24, 119, 242, 0.3);
}

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

.submit-btn:disabled {
    background: #e4e6ea;
    color: #bcc0c4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.submit-btn.disabled {
    background: #e4e6ea;
    color: #bcc0c4;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
    pointer-events: none;
}

.back-btn {
    background: none;
    border: none;
    color: #1877f2;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 20px;
    padding: 8px 0;
    transition: color 0.2s ease;
}

.back-btn:hover {
    color: #166fe5;
    text-decoration: underline;
}

.link-btn {
    background: none;
    border: none;
    color: #1877f2;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.link-btn:hover {
    color: #166fe5;
}

/* Messages */
.message {
    margin-top: 16px;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    text-align: center;
    display: none;
}

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

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

.message.info {
    background: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

/* Resend section */
.resend-section {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid #e4e6ea;
}

.resend-section p {
    color: #65676b;
    font-size: 14px;
    margin-bottom: 8px;
}

/* Loading states */
.loading {
    position: relative;
    pointer-events: none;
}

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

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

/* Mobile responsiveness */
@media (max-width: 768px) {
    .main-container {
        padding: 10px;
    }
    
    .login-card {
        padding: 30px 20px;
        max-width: 100%;
        margin: 0 10px;
    }
    
    .logo-section h1 {
        font-size: 24px;
    }
    
    .step-container h2 {
        font-size: 20px;
    }
    
    .login-btn {
        padding: 16px;
    }
    
    .btn-text {
        font-size: 16px;
    }
    
    .form-input {
        padding: 12px 14px;
        font-size: 16px; /* Prevents zoom on iOS */
    }
    
    .submit-btn {
        padding: 12px 18px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .login-card {
        padding: 24px 16px;
    }
    
    .logo-section h1 {
        font-size: 22px;
    }
    
    .subtitle {
        font-size: 14px;
    }
    
    .step-container h2 {
        font-size: 18px;
    }
    
    .step-description {
        font-size: 14px;
    }
}

/* Additional utility classes */
.text-center {
    text-align: center;
}

.mt-10 {
    margin-top: 10px;
}

.mt-20 {
    margin-top: 20px;
}

.mb-10 {
    margin-bottom: 10px;
}

.mb-20 {
    margin-bottom: 20px;
}

/* Form validation states */
.form-input.error {
    border-color: #dc3545;
    background: #fff5f5;
}

.form-input.success {
    border-color: #28a745;
    background: #f8fff8;
}

/* Focus trap for accessibility */
.login-card:focus-within {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
