:root {
    --primary-teal: #2999c9;
    --secondary-teal: #57bee0;
    --main-text-color: #03425D;
    --text-muted: #859EA4;
    --border-color: #cccccc;
    --error-color: #ef4444;
    --success-color: #10B981;
    --gray-color: #CCCCCC;
    --hover-bg-color-light: rgba(16 188 219 /0.2);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Montserrat", sans-serif;
    background: linear-gradient(90deg, #F8FAFB 0%, #E6F3F5 100%);
    color: var(--main-text-color);
    display: flex;
    padding-top: 3rem;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

/* Animated background elements */
body::before,
body::after {
    content: '';
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    z-index: 0;
    animation: float 20s infinite ease-in-out;
}

body::before {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

body::after {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, var(--secondary-teal), var(--primary-teal));
    bottom: -150px;
    right: -150px;
    animation-delay: 3s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(50px, 50px) rotate(120deg);
    }
    66% {
        transform: translate(-30px, 30px) rotate(240deg);
    }
}

/* Login container */
.login-container {
    width: 100%;
    max-width: 440px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Login card */
.login-card {
    background: white;
    border-radius: 20px;
    padding: 2rem 2.5rem;
    box-shadow: 
        0 20px 60px rgba(16 188 219 /0.1),
        0 8px 24px rgba(16 188 219 /0.2);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

/* Gradient accent at top */
.login-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-teal), var(--secondary-teal));
}

/* Logo section */
.logo-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.logo-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    border-radius: 20px;
    margin-bottom: 1.5rem;
    box-shadow: 0 8px 24px rgba(16 188 219 /0.2);
    animation: pulse 2s infinite ease-in-out;
}

@keyframes pulse {
    0%, 100% {
        transform: scale(1);
        box-shadow: 0 8px 24px rgba(16 188 219 /0.25);
    }
    50% {
        transform: scale(1.05);
        box-shadow: 0 12px 32px rgba(16 188 219 /0.25);
    }
}

.logo-container i {
    font-size: 2rem;
    color: white;
}

.logo-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--main-text-color);
    margin-bottom: 0.5rem;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-subtitle {
    font-size: 0.9375rem;
    color: var(--text-muted);
    margin-bottom: 0;
}

/* Password toggle */
.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.125rem;
    padding: 0.25rem;
    line-height: 1;
    transition: color 0.3s ease;
}

.password-toggle:hover {
    color: var(--primary-teal);
}

/* Error message */
.error-message {
    display: none;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
    font-size: 0.8125rem;
    color: var(--error-color);
    animation: slideDown 0.3s ease-out;
}

.error-message.show {
    display: flex;
}

.error-message i {
    font-size: 1rem;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Remember me checkbox */
.remember-me {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1.5rem;
}

.remember-me input[type="checkbox"] {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    accent-color: var(--primary-teal);
}

.remember-me label {
    font-size: 0.875rem;
    color: var(--main-text-color);
    cursor: pointer;
    user-select: none;
}

/* Buttons */
.btn-login {
    width: 100%;
    padding: 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px  rgba(16 188 219 /0.2);
    position: relative;
    overflow: hidden;
}

.btn-login::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-login:hover::before {
    left: 100%;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px  rgba(16 188 219 /0.2);
}

.btn-login:active {
    transform: translateY(0);
}

.btn-login:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

.btn-login .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
}

.btn-login.loading .spinner {
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1rem 0;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.divider span {
    padding: 0 1rem;
    color: var(--text-muted);
    font-size: 0.875rem;
}

/* Links */
.forgot-password {
    display: block;
    text-align: center;
    color: var(--primary-teal);
    font-size: 0.9375rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s ease;
    padding: 0.75rem;
    border-radius: 8px;
}

.forgot-password:hover {
    background: rgba(0, 186, 183, 0.08);
    color: var(--secondary-teal);
}

.signup-link {
    text-align: center;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.signup-link a {
    color: var(--primary-teal);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease;
}

.signup-link a:hover {
    color: var(--secondary-teal);
    text-decoration: underline;
}

/* Alert message */
.alert-box {
    display: none;
    padding: 1rem 1.25rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    animation: slideDown 0.3s ease-out;
}

.alert-box.show {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.alert-box.error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error-color);
}

.alert-box.success {
    background: rgba(34, 197, 94, 0.1);
    border: 1px solid rgba(34, 197, 94, 0.3);
    color: var(--success-color);
}

.alert-box i {
    font-size: 1.25rem;
}

.alert-box .alert-content {
    flex: 1;
}

.alert-box .alert-title {
    font-weight: 600;
    margin-bottom: 0.25rem;
}

.alert-box .alert-message {
    font-size: 0.875rem;
    opacity: 0.9;
}

.alert-close {
    background: none;
    border: none;
    color: currentColor;
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.alert-close:hover {
    opacity: 1;
}

/* Responsive */
@media (max-width: 576px) {
    .login-card {
        padding: 2rem 1.5rem;
    }

    .logo-container {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }

    .logo-container i {
        font-size: 2rem;
    }

    .logo-title {
        font-size: 1.5rem;
    }

    .logo-subtitle {
        font-size: 0.875rem;
    }

    .form-input {
        padding: 0.5rem 1rem;
        padding-left: 2.75rem;
    }

    .btn-login {
        padding: 0.875rem;
    }
}

/* Focus visible for keyboard navigation */
*:focus-visible {
    outline-offset: 2px;
}

/* Loading overlay */
.loading-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(255, 255, 255, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}

.loading-overlay.show {
    display: flex;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top-color: var(--primary-teal);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* Container */
.forgot-password-container {
    width: 100%;
    max-width: 500px;
    position: relative;
    z-index: 1;
    animation: fadeInUp 0.6s ease-out forwards;
    opacity: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card */
.forgot-password-card {
    background: white;
    border-radius: 20px;
    padding: 2rem 2.5rem;
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.08),
        0 8px 24px rgba(16 188 219 /0.3);
    border: 1px solid var(--border-color);
    position: relative;
    overflow: hidden;
}

/* Gradient accent at top */
.forgot-password-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--primary-teal), var(--secondary-teal));
}

/* Header section */
.header-section {
    text-align: center;
    margin-bottom: 1.5rem;
}

.back-to-login {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-teal);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    margin-bottom: 1.5rem;
}

.back-to-login:hover {
    background: rgba(0, 186, 183, 0.08);
    color: var(--secondary-teal);
}

.icon-container {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, rgba(0, 186, 183, 0.1), rgba(16, 188, 219, 0.1));
    border-radius: 20px;
    margin-bottom: 1.5rem;
    border: 2px solid rgba(0, 186, 183, 0.2);
}

.icon-container i {
    font-size: 2rem;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--main-text-color);
    margin-bottom: 0.75rem;
}

.page-description {
    font-size: 0.9375rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin-bottom: 0;
}

/* Form elements */
.form-group {
    margin-bottom: 1rem;
    position: relative;
}

.form-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--main-text-color);
    margin-bottom: 0.5rem;
}

.form-label.required::after {
    content: '*';
    color: var(--error-color);
    margin-left: 0.25rem;
}

.helper-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin-top: 0.5rem;
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    line-height: 1.5;
}

.helper-text i {
    margin-top: 0.125rem;
    flex-shrink: 0;
}

.input-wrapper {
    position: relative;
}
.captcha-widget .form-input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}
.form-input {
    width: 100%;
    padding: 0.5rem 1rem;
    padding-left: 3rem;
    font-size: 0.9375rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    outline: none;
    transition: all 0.3s ease;
    color: var(--main-text-color);
}

.form-input:focus {
    border-color: var(--primary-teal);
    box-shadow: 0 0 0 4px rgba(0, 186, 183, 0.1);
}

.form-input.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.02);
}

.form-input.error:focus {
    box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1);
}

.form-input.success {
    border-color: var(--success-color);
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.125rem;
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-input:focus + .input-icon {
    color: var(--primary-teal);
}

.form-input.error + .input-icon {
    color: var(--error-color);
}

.form-input.success + .input-icon {
    color: var(--success-color);
}


/* CAPTCHA container */
.captcha-container {
    margin-bottom: 1.5rem;
}

.captcha-label {
    display: block;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--main-text-color);
    margin-bottom: 0.75rem;
}

.captcha-label.required::after {
    content: '*';
    color: var(--error-color);
    margin-left: 0.25rem;
}

.captcha-widget {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 1.25rem;
    background: var(--hover-bg-color-light);
    transition: all 0.3s ease;
    display: grid;
    grid-template-columns: 80px 1fr;
}

.captcha-widget.error {
    border-color: var(--error-color);
    background: rgba(239, 68, 68, 0.02);
}

.captcha-widget.success {
    border-color: var(--success-color);
    background: rgba(34, 197, 94, 0.02);
}

.captcha-content {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.captcha-checkbox-wrapper {
    position: relative;
}

.captcha-checkbox {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-color);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: white;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.captcha-checkbox:hover {
    border-color: var(--primary-teal);
}

.captcha-checkbox.checked {
    background: var(--success-color);
    border-color: var(--success-color);
}

.captcha-checkbox i {
    color: white;
    font-size: 1.125rem;
    display: none;
}

.captcha-checkbox.checked i {
    display: block;
    animation: checkPop 0.3s ease-out;
}

@keyframes checkPop {
    0% {
        transform: scale(0);
    }
    50% {
        transform: scale(1.2);
    }
    100% {
        transform: scale(1);
    }
}

.captcha-text {
    flex: 1;
}

.captcha-label-text {
    font-size: 0.9375rem;
    color: var(--main-text-color);
    font-weight: 500;
    margin-bottom: 0;
}

.captcha-info {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem;
    background: var(--gray-color);
    border-top-left-radius: 8px;
    border-bottom-left-radius: 8px;
    min-width: 50px;
}

.captcha-info i {
    color: var(--text-muted);
    font-size: 1rem;
}

.captcha-info-text {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.4;
}

.captcha-info-link {
    color: var(--primary-teal);
    text-decoration: none;
    font-weight: 600;
}

.captcha-info-link:hover {
    text-decoration: underline;
}

/* Buttons */
.button-group {
    display: flex;
    gap: 1rem;
    margin-top: 2rem;
}

.btn-reset {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: white;
    background: linear-gradient(135deg, var(--primary-teal), var(--secondary-teal));
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 186, 183, 0.3);
    position: relative;
    overflow: hidden;
}

.btn-reset::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.btn-reset:hover::before {
    left: 100%;
}

.btn-reset:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 186, 183, 0.4);
}

.btn-reset:active:not(:disabled) {
    transform: translateY(0);
}

.btn-reset:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

.btn-reset .spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid white;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 0.5rem;
}

.btn-reset.loading .spinner {
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-cancel {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--main-text-color);
    background: white;
    border: 2px solid var(--border-color);
    border-radius: 8px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-cancel:hover {
    background: var(--border-color);
    border-color: var(--text-muted);
}

.btn-cancel:active {
    transform: scale(0.98);
}

/* Toast notification */
.toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    max-width: 400px;
    width: 100%;
}

.toast {
    background: white;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    border-left: 4px solid;
    display: none;
    align-items: flex-start;
    gap: 1rem;
    animation: slideInRight 0.3s ease-out;
    position: relative;
}

.toast.show {
    display: flex;
}

@keyframes slideInRight {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.toast.success {
    border-left-color: var(--success-color);
}

.toast.error {
    border-left-color: var(--error-color);
}

.toast.warning {
    border-left-color: var(--warning-color);
}

.toast-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.toast.success .toast-icon {
    background: rgba(34, 197, 94, 0.1);
    color: var(--success-color);
}

.toast.error .toast-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.toast.warning .toast-icon {
    background: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.toast-icon i {
    font-size: 1.25rem;
}

.toast-content {
    flex: 1;
}

.toast-title {
    font-weight: 700;
    color: var(--main-text-color);
    margin-bottom: 0.25rem;
    font-size: 0.9375rem;
}

.toast-message {
    color: var(--text-muted);
    font-size: 0.875rem;
    line-height: 1.5;
    margin: 0;
}

.toast-close {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 1.25rem;
    padding: 0;
    line-height: 1;
    transition: color 0.3s ease;
    flex-shrink: 0;
}

.toast-close:hover {
    color: var(--main-text-color);
}

.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    border-radius: 0 0 0 12px;
    animation: progress 5s linear;
}

.toast.success .toast-progress {
    color: var(--success-color);
}

.toast.error .toast-progress {
    color: var(--error-color);
}

.toast.warning .toast-progress {
    color: var(--warning-color);
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* Screen reader only */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Responsive */
@media (max-width: 576px) {
    .forgot-password-card {
        padding: 2rem 1.5rem;
    }

    .icon-container {
        width: 70px;
        height: 70px;
        margin-bottom: 1rem;
    }

    .icon-container i {
        font-size: 2rem;
    }

    .page-title {
        font-size: 1.5rem;
    }

    .page-description {
        font-size: 0.875rem;
    }

    .form-input {
        padding: 0.75rem 1rem;
        padding-left: 2.75rem;
    }

    .button-group {
        flex-direction: column-reverse;
    }

    .btn-reset,
    .btn-cancel {
        width: 100%;
        padding: 0.875rem;
    }

    .toast-container {
        top: 1rem;
        right: 1rem;
        left: 1rem;
        max-width: none;
    }
}
