/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f5f5f5;
    min-height: 100vh;
}

/* Header */
.header {
    background: white;
    border-bottom: 1px solid #e0e0e0;
    padding: 16px 24px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.header-content {
    max-width: 1200px;
    margin: 0 auto;
}

.logo-title {
    font-size: 24px;
    font-weight: 600;
    color: #4285f4;
    margin: 0;
}

/* Main container */
.login-container {
    background-color: #f5f5f5;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 40px 20px;
}

/* White card container */
.login-card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 480px;
    padding: 48px 40px 32px 40px;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    /* background: #4285f4; */
}

/* Title section */
.title-section {
    margin-bottom: 40px;
}

.page-title {
    font-size: 24px;
    font-weight: 600;
    color: #202124;
    margin-bottom: 12px;
}

.subtitle-text {
    font-size: 15px;
    color: #5f6368;
    font-weight: 400;
    line-height: 1.5;
}

/* Success message */
.success-message {
    background: linear-gradient(135deg, #e8f5e8, #f1f8f1);
    border: 1px solid #c3e6c3;
    color: #2e7d32;
    padding: 20px 24px;
    border-radius: 8px;
    margin-bottom: 32px;
    display: flex;
    align-items: flex-start;
    text-align: left;
    animation: slideIn 0.4s ease;
}

.success-icon {
    width: 24px;
    height: 24px;
    margin-right: 16px;
    flex-shrink: 0;
    margin-top: 2px;
}

.success-message h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
    color: #2e7d32;
}

.success-message p {
    font-size: 14px;
    line-height: 1.5;
    margin: 0;
    color: #2e7d32;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form styles */
.login-form {
    margin-bottom: 32px;
}

.form-group {
    margin-bottom: 26px;
    text-align: left;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #202124;
    margin-bottom: 8px;
    font-weight: 500;
}

/* Input wrapper for icons */
.input-wrapper {
    position: relative;
}

.input-field {
    width: 100%;
    height: 52px;
    padding: 0 48px 0 18px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    font-size: 16px;
    background: white;
    transition: all 0.2s ease;
    outline: none;
    color: #202124;
}

.input-field:focus {
    border-color: #4285f4;
    box-shadow: 0 2px 8px rgba(66, 133, 244, 0.2);
    transform: translateY(-1px);
}

.input-field::placeholder {
    color: #9aa0a6;
}

.input-field.error {
    border-color: #ea4335;
    background-color: #fef7f0;
}

.input-field.error:focus {
    border-color: #ea4335;
    box-shadow: 0 2px 8px rgba(234, 67, 53, 0.2);
}

/* Input icons */
.input-icon {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    color: #9aa0a6;
    pointer-events: none;
}

.input-icon svg {
    width: 20px;
    height: 20px;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #5f6368;
    padding: 4px;
    border-radius: 4px;
    transition: color 0.2s ease;
}

.password-toggle:hover {
    color: #202124;
}

.eye-icon {
    width: 18px;
    height: 18px;
}

/* Checkbox group */
.checkbox-group {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
}

/* Checkbox container */
.checkbox-container {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 14px;
    color: #5f6368;
    gap: 12px;
}

.checkbox-input {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid #dadce0;
    border-radius: 4px;
    background-color: white;
    flex-shrink: 0;
    position: relative;
    transition: all 0.2s ease;
}

.checkbox-input:checked+.checkmark {
    background-color: #4285f4;
    border-color: #4285f4;
}

.checkbox-input:checked+.checkmark::after {
    content: '';
    position: absolute;
    left: 5px;
    top: 1px;
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.checkbox-text {
    flex: 1;
}

.forgot-password {
    font-size: 14px;
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

.forgot-password:hover {
    text-decoration: underline;
    color: #1765cc;
}

/* Primary button */
.btn-primary {
    width: 100%;
    height: 54px;
    background: #1a73e8;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 32px;
    transition: all 0.2s ease;
    letter-spacing: 0.25px;
}

.btn-primary:hover {
    background: #1765cc;
    box-shadow: 0 2px 8px rgba(26, 115, 232, 0.3);
    transform: translateY(-1px);
}

.btn-primary:disabled {
    background: #9aa0a6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-primary .btn-icon {
    width: 20px;
    height: 20px;
    margin-right: 10px;
}

/* Spinning animation for loading state */
.animate-spin {
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Social section */
.social-section {
    margin-bottom: 32px;
}

.divider {
    margin: 24px 0;
    position: relative;
    text-align: center;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: #dadce0;
}

.divider span {
    background: white;
    color: #5f6368;
    font-size: 13px;
    padding: 0 16px;
    position: relative;
}

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

.btn-social {
    flex: 1;
    height: 48px;
    border: 1px solid #dadce0;
    border-radius: 6px;
    background: white;
    color: #5f6368;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.btn-social:hover {
    background: #f8f9fa;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: translateY(-1px);
}

.btn-social.google:hover {
    border-color: #4285f4;
    color: #4285f4;
}

.btn-social.hvn {
    background: #d93025;
    color: white;
    border-color: #d93025;
}

.btn-social.hvn:hover {
    background: #c5271e;
    border-color: #c5271e;
    color: white;
}

.social-icon {
    width: 18px;
    height: 18px;
    margin-right: 8px;
}

/* Links section */
.links-section {
    text-align: center;
}

.register-link {
    font-size: 14px;
    color: #5f6368;
    margin-bottom: 16px;
}

.register-link a {
    color: #34a853;
    text-decoration: none;
    font-weight: 500;
}

.register-link a:hover {
    text-decoration: underline;
}

.help-text {
    font-size: 13px;
    color: #5f6368;
}

.help-text a {
    color: #1a73e8;
    text-decoration: none;
    font-weight: 500;
}

.help-text a:hover {
    text-decoration: underline;
}

/* Error messages */
.error-message {
    color: #ea4335;
    font-size: 13px;
    margin-top: 8px;
    display: none;
    align-items: center;
    gap: 6px;
}

.error-message::before {
    content: '⚠';
    font-size: 14px;
}

.error-message:not(:empty) {
    display: flex;
}

/* Responsive design */
@media (max-width: 600px) {
    .header {
        padding: 12px 16px;
    }

    .login-container {
        padding: 70px 16px 40px 16px;
    }

    .login-card {
        padding: 32px 24px 24px 24px;
        max-width: 100%;
        margin: 0 8px;
    }

    .page-title {
        font-size: 20px;
    }

    .subtitle-text {
        font-size: 14px;
    }

    .input-field {
        font-size: 16px;
        height: 48px;
    }

    .btn-primary {
        height: 48px;
        font-size: 15px;
    }

    .checkbox-group {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .forgot-password {
        align-self: flex-end;
    }

    .social-buttons {
        flex-direction: column;
    }

    .success-message {
        padding: 16px 20px;
    }
}

/* Focus states for better accessibility */
.input-field:focus,
.btn-primary:focus,
.btn-social:focus,
.checkbox-container:focus-within .checkmark {
    outline: 2px solid #4285f4;
    outline-offset: 2px;
}

/* Enhanced hover effects */
.input-field:hover:not(.error) {
    border-color: #5f6368;
}

.login-card {
    animation: fadeInUp 0.5s ease;
}

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Custom scrollbar for mobile */
.login-card {
    max-height: 90vh;
    overflow-y: auto;
}

.login-card::-webkit-scrollbar {
    width: 4px;
}

.login-card::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.login-card::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 2px;
}

.login-card::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}