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

/* Disable browser's default validation messages */
form input:invalid,
form select:invalid,
form textarea:invalid {
    box-shadow: none;
}

form input:invalid:focus,
form select:invalid:focus,
form textarea:invalid:focus {
    box-shadow: none;
    outline: none;
}

/* Hide browser's default validation tooltip */
form input:invalid::-webkit-validation-bubble,
form select:invalid::-webkit-validation-bubble,
form textarea:invalid::-webkit-validation-bubble {
    display: none;
}

/* jqBootstrapValidation styles (matching Admin-Themes) */
.form-group.error input,
.form-group.error select,
.form-group.error textarea {
    border-color: #f64e60;
}

.form-group.error .help-block ul {
    padding: 0px;
    margin: 6px 0 0 0;
    color: #f64e60;
    list-style: none;
    font-size: 0.875rem;
}

.form-group.error .help-block ul li {
    list-style: none;
}

.form-group.validate input,
.form-group.validate select,
.form-group.validate textarea {
    border-color: #1bc5bd;
}

.form-group.issue .help-block ul {
    padding: 0px;
    margin: 6px 0 0 0;
    color: #ffa800;
    list-style: none;
    font-size: 0.875rem;
}

.form-group.issue .help-block ul li {
    list-style: none;
}

.form-group.has-error .help-block {
    color: #f64e60;
    font-size: 0.875rem;
    margin-top: 6px;
}

.form-group.has-error label {
    color: #f64e60;
}

.form-group.has-error .form-input {
    border-color: #f64e60;
    box-shadow: none;
}

.form-group.has-success .help-block {
    color: #1bc5bd;
    font-size: 0.875rem;
    margin-top: 6px;
}

.form-group.has-success label {
    color: #1bc5bd;
}

.form-group.has-success .form-input {
    border-color: #1bc5bd;
    box-shadow: none;
}

/* Help block styling */
.help-block {
    display: block;
    margin-top: 6px;
    margin-bottom: 0;
    font-size: 0.875rem;
    line-height: 1.4;
}

.help-block ul {
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Improved Bootstrap validation styles */
.was-validated .form-input:valid,
.was-validated .form-input.is-valid {
    border-color: #10b981 !important;
    background-color: #f0fdf4 !important;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3e%3cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z' fill='%2310b981'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
    animation: validPulse 0.3s ease-out;
}

.was-validated .form-input:invalid,
.was-validated .form-input.is-invalid {
    border-color: #ef4444 !important;
    background-color: #fef2f2 !important;
    padding-right: 42px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16' fill='none'%3e%3cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z' fill='%23ef4444'/%3e%3cpath d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z' fill='%23ef4444'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 18px 18px;
    animation: invalidShake 0.4s ease-out;
}

/* Validation animations */
@keyframes validPulse {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.01);
    }
    100% {
        transform: scale(1);
    }
}

@keyframes invalidShake {
    0%, 100% {
        transform: translateX(0);
    }
    10%, 30%, 50%, 70%, 90% {
        transform: translateX(-4px);
    }
    20%, 40%, 60%, 80% {
        transform: translateX(4px);
    }
}

.invalid-feedback {
    display: none;
    width: 100%;
    margin-top: 6px;
    font-size: 0.813rem;
    color: #ef4444;
    font-weight: 500;
    padding-left: 4px;
    animation: slideDown 0.3s ease-out;
    line-height: 1.4;
}

.invalid-feedback::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3e%3cpath d='M8 15A7 7 0 1 1 8 1a7 7 0 0 1 0 14zm0 1A8 8 0 1 0 8 0a8 8 0 0 0 0 16z' fill='%23ef4444'/%3e%3cpath d='M7.002 11a1 1 0 1 1 2 0 1 1 0 0 1-2 0zM7.1 4.995a.905.905 0 1 1 1.8 0l-.35 3.507a.552.552 0 0 1-1.1 0L7.1 4.995z' fill='%23ef4444'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-right: 6px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.was-validated .form-input:invalid ~ .invalid-feedback,
.was-validated .form-input:invalid ~ .invalid-tooltip,
.form-input.is-invalid ~ .invalid-feedback,
.form-input.is-invalid ~ .invalid-tooltip {
    display: block;
}

.valid-feedback {
    display: none;
    width: 100%;
    margin-top: 6px;
    font-size: 0.813rem;
    color: #10b981;
    font-weight: 500;
    padding-left: 4px;
    animation: slideDown 0.3s ease-out;
    line-height: 1.4;
}

.valid-feedback::before {
    content: '';
    display: inline-block;
    width: 14px;
    height: 14px;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 16 16' fill='none'%3e%3cpath d='M13.854 3.646a.5.5 0 0 1 0 .708l-7 7a.5.5 0 0 1-.708 0l-3.5-3.5a.5.5 0 1 1 .708-.708L6.5 10.293l6.646-6.647a.5.5 0 0 1 .708 0z' fill='%2310b981'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
    margin-right: 6px;
    vertical-align: middle;
    position: relative;
    top: -1px;
}

.was-validated .form-input:valid ~ .valid-feedback,
.was-validated .form-input:valid ~ .valid-tooltip,
.form-input.is-valid ~ .valid-feedback,
.form-input.is-valid ~ .valid-tooltip {
    display: block;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form input base styles with better transitions */
.form-input {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.form-input:focus:not(.is-invalid):not(.is-valid) {
    border-color: #05a68b;
    box-shadow: 0 0 0 0.25rem rgba(5, 166, 139, 0.25);
}

.form-input.is-invalid:focus {
    border-color: #ff3f3f;
    box-shadow: 0 0 0 0.25rem rgba(255, 63, 63, 0.25);
}

.form-input.is-valid:focus {
    border-color: #28a745;
    box-shadow: 0 0 0 0.25rem rgba(40, 167, 69, 0.25);
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #ffffff;
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    /* Subtle, scattered light blue dots background */
    background-image: radial-gradient(circle at 1px 1px, #e0f7fa 1px, transparent 0);
    background-size: 20px 20px;
}

/* Header */
.login-header {
    background-color: #fff;
    padding: 20px 50px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: none;
    position: relative;
    z-index: 10;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.login-header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-header-logo img {
    height: 30px;
    width: 30px;
    object-fit: contain;
}

.login-header-logo .logo-text {
    height: 21px;
    width: auto;
}

.header-signup {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-signup-text {
    font-size: 14px;
    color: #54595f;
    font-weight: 400;
}

.header-signup-btn {
    background-color: #05a68b;
    color: #fff;
    padding: 8px 20px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
}

.header-signup-btn:hover {
    background-color: #048a73;
    color: #fff;
    text-decoration: none;
}

/* Main Content */
.login-main-content {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 81px);
    padding: 20px;
    position: relative;
    z-index: 1;
}

.login-form-container {
    background-color: #fff;
    border-radius: 8px;
    max-width: 600px;
    width: 100%;
    text-align: center;
}

.login-title {
    font-size: 28px;
    font-weight: 700;
    color: #212121;
    margin-bottom: 32px;
    text-align: center;
}

/* Google Sign-in Section */
.google-signin-section {
    margin-bottom: 24px;
}

.google-btn-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    position: relative;
}

.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 11px 20px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    background-color: #fff;
    color: #212121;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    gap: 10px;
}

.google-signin-btn:hover {
    border-color: #d0d0d0;
    background-color: #fafafa;
}

.google-signin-btn svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.recommended-tag {
    position: absolute;
    top: -8px;
    right: 8px;
    background-color: #004c3d;
    color: #fff;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: 3px;
    font-weight: 600;
    white-space: nowrap;
    line-height: 1.2;
}

.google-info-banner {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    background-color: #e3fff8;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    color: #004c3d;
    text-align: left;
    line-height: 1.4;
}

.google-info-banner i {
    color: #05a68b;
    font-size: 14px;
    margin-top: 2px;
    flex-shrink: 0;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
}

.divider-line {
    flex: 1;
    height: 1px;
    background-color: #e0e0e0;
}

.divider-text {
    font-size: 13px;
    color: #9e9e9e;
    font-weight: 500;
    padding: 0 8px;
}

/* Form */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 0;
    text-align: left;
}

.form-group {
    margin-bottom: 18px;
}

.form-label {
    display: block;
    font-size: 14px;
    color: #212121;
    font-weight: 600;
    margin-bottom: 6px;
}

.form-input {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 15px;
    color: #212121;
    background-color: #F4F6FC;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-input::placeholder {
    color: #9e9e9e;
}

.form-input:focus {
    outline: none;
    border-color: #05a68b;
    box-shadow: 0 0 0 0.25rem rgba(5, 166, 139, 0.25);
}

/* Password Input Wrapper with Eye Icon */
.password-input-wrapper {
    position: relative;
    width: 100%;
}

.password-input-wrapper .form-input {
    padding-right: 45px; /* Space for eye icon */
}

.password-toggle-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #9e9e9e;
    font-size: 16px;
    transition: color 0.2s ease;
    z-index: 10;
}

.password-toggle-icon:hover {
    color: #05a68b;
}

.password-toggle-icon.active {
    color: #05a68b;
}

.password-info-text {
    font-size: 12px;
    color: #9e9e9e;
    text-align: left;
    margin-top: -4px;
    margin-bottom: 12px;
    line-height: 1.4;
}

.forgot-password-link {
    display: inline-block;
    text-align: left;
    color: #1976D2;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 20px;
}

.forgot-password-link:hover {
    text-decoration: underline;
    color: #1565C0;
}

.signin-btn {
    width: 100%;
    padding: 13px 24px;
    background-color: #004c3d;
    color: #fff;
    border: none;
    border-radius: 4px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color 0.2s ease;
    margin-top: 4px;
}

.signin-btn:hover {
    background-color: #003d2f;
}

/* Responsive */
@media (max-width: 768px) {
    .login-header {
        padding: 15px 20px;
    }

    .login-form-container {
        padding: 40px 24px;
        max-width: 100%;
    }

    .login-title {
        font-size: 28px;
        margin-bottom: 30px;
    }

    .google-signin-btn {
        min-width: 100%;
        flex-direction: column;
        gap: 8px;
    }

    .google-btn-wrapper {
        flex-direction: column;
        align-items: stretch;
    }

    .recommended-tag {
        align-self: center;
    }
}

/* Modal Styles */
.modal {
    z-index: 1055;
}

.modal-backdrop {
    z-index: 1050;
    background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.modal-header {
    border-bottom: 1px solid #e0e0e0;
    padding: 20px 24px;
}

.modal-title {
    font-size: 20px;
    font-weight: 700;
    color: #212121;
}

.modal-body {
    padding: 24px;
}

.modal-body .form-group {
    margin-bottom: 18px;
}

.modal-body .help-block {
    margin-top: 5px;
    font-size: 13px;
}

.modal-body .form-text {
    font-size: 12px;
    margin-top: 5px;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    opacity: 0.5;
    padding: 0;
    margin: 0;
    width: 1em;
    height: 1em;
}

.btn-close:hover {
    opacity: 1;
}

/* Ensure modal is visible when shown */
.modal.show {
    display: block !important;
}

.modal.show .modal-dialog {
    transform: none;
}
