* {
    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;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
    /* Subtle, scattered light blue dots background */
    background-image: radial-gradient(circle at 1px 1px, #e0f7fa 1px, transparent 0);
    background-size: 20px 20px;
}

/* Allow selecting text inside form fields (better UX) */
input,
textarea {
    -webkit-user-select: text;
    -ms-user-select: text;
    user-select: text;
}

/* 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;
    -webkit-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

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

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

#moon-icon {
    display: none;
}

.header-right-actions {
    display: flex;
    align-items: center;
    gap: 16px;
}

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

.theme-toggle {
    background: transparent;
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #54595f;
}

.theme-toggle:hover {
    background-color: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
}

.theme-toggle i {
    font-size: 18px;
    transition: color 0.3s ease;
}

.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 !important;
    align-items: center !important;
    justify-content: flex-start !important;
    width: min(520px, 100%) !important;
    padding: 14px 18px !important;
    border: 1px solid #dadce0 !important;
    border-radius: 16px !important;
    background: #ffffff !important;
    color: #3c4043 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    cursor: pointer;
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease, border-color 160ms ease;
    gap: 14px !important;
    flex-wrap: nowrap !important;
    white-space: nowrap !important;
}

.google-signin-btn:hover {
    background: #ffffff !important;
    border-color: #c6cacf !important;
    box-shadow: 0 6px 18px rgba(60, 64, 67, 0.18);
    transform: translateY(-1px);
}

.google-signin-btn .google-icon,
.google-signin-btn img.google-icon {
    width: 26px !important;
    height: 26px !important;
    flex: 0 0 auto !important;
    min-width: 26px !important;
    object-fit: contain;
}

.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;
}

/* Screenshot-style: hide "Recommended" chip */
.recommended-tag {
    display: none !important;
}

.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;
}

/* =========================
   Modern Login Redesign (Theme-aware)
   NOTE: Do not change HTML ids/classes; overrides only.
   ========================= */

body.light-mode {
    --login-bg: radial-gradient(1200px 600px at 10% 10%, rgba(20, 184, 166, 0.14) 0%, rgba(255, 255, 255, 0) 55%),
        radial-gradient(900px 600px at 90% 15%, rgba(59, 130, 246, 0.10) 0%, rgba(255, 255, 255, 0) 55%),
        linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    --login-surface: rgba(255, 255, 255, 0.82);
    --login-surface-solid: #ffffff;
    --login-border: rgba(17, 24, 39, 0.10);
    --login-text: #0f172a;
    --login-muted: rgba(15, 23, 42, 0.72);
    --login-muted-2: rgba(15, 23, 42, 0.55);
    --login-accent: #14B8A6;
    --login-accent-2: #0D9488;
    --login-focus: rgba(20, 184, 166, 0.25);
    --login-shadow: 0 22px 60px rgba(15, 23, 42, 0.10);
}

body.dark-mode {
    --login-bg: radial-gradient(1100px 700px at 10% 15%, rgba(20, 184, 166, 0.18) 0%, rgba(11, 18, 32, 0) 55%),
        radial-gradient(900px 700px at 85% 10%, rgba(140, 180, 255, 0.16) 0%, rgba(11, 18, 32, 0) 55%),
        linear-gradient(135deg, #0b1220 0%, #0f172a 100%);
    --login-surface: rgba(31, 41, 55, 0.62);
    --login-surface-solid: #111827;
    --login-border: rgba(255, 255, 255, 0.10);
    --login-text: #f9fafb;
    --login-muted: rgba(209, 213, 219, 0.86);
    --login-muted-2: rgba(209, 213, 219, 0.65);
    --login-accent: #8cb4ff;
    --login-accent-2: #2dd4bf;
    --login-focus: rgba(140, 180, 255, 0.25);
    --login-shadow: 0 26px 70px rgba(0, 0, 0, 0.45);
}

body {
    background-image: var(--login-bg) !important;
    background-size: cover !important;
}

.login-header {
    background: transparent !important;
    box-shadow: none !important;
    border-bottom: 1px solid var(--login-border);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.login-header-logo .logo-text {
    filter: none;
}

.header-signup-text {
    color: var(--login-muted);
}

.header-signup-btn {
    background: linear-gradient(135deg, var(--login-accent) 0%, var(--login-accent-2) 100%);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(20, 184, 166, 0.22);
}

body.dark-mode .header-signup-btn {
    box-shadow: 0 14px 34px rgba(140, 180, 255, 0.18);
}

.theme-toggle {
    border-color: var(--login-border) !important;
    color: var(--login-muted) !important;
    background: rgba(255, 255, 255, 0.0) !important;
}

body.dark-mode .theme-toggle:hover {
    background: rgba(255, 255, 255, 0.06) !important;
}

.login-main-content {
    padding: 22px 10px !important; /* reduced left/right space */
}

.login-layout {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 28px;
    align-items: center;
}

@media (max-width: 1400px) {
    .login-layout {
        max-width: 95%;
    }
}

@media (max-width: 992px) {
    .login-layout {
        max-width: 100%;
        padding: 0 20px;
    }
}

.login-form-container {
    background: var(--login-surface) !important;
    border: 1px solid var(--login-border);
    border-top: 6px solid #0e978b;
    border-radius: 18px !important;
    box-shadow: var(--login-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 36px 34px !important;
}

/* Theme-specific top border accent */
body.dark-mode .login-form-container {
    border-top-color: var(--login-accent);
}

.login-hero {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
}

.login-hero-card {
    background: transparent;
    border: none;
    border-radius: 0;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    padding: 0;
    overflow: visible;
}

.login-hero-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
    filter: drop-shadow(0 22px 36px rgba(17, 24, 39, 0.08));
    transition: transform 450ms cubic-bezier(.2,.8,.2,1), opacity 450ms ease, filter 450ms ease;
    will-change: transform, opacity, filter;
    opacity: 0;
    transform: translateY(18px) scale(0.985);
}

.login-hero-image.animate {
    opacity: 1;
    transform: translateY(0) scale(1);
}

.login-hero:hover .login-hero-image.animate,
.login-hero-image.animate:hover {
    transform: translateY(-10px) scale(1.02) rotate(-0.4deg);
    filter: drop-shadow(0 26px 46px rgba(17, 24, 39, 0.12));
}

body.dark-mode .login-hero-image {
    filter: grayscale(1) drop-shadow(0 22px 36px rgba(0, 0, 0, 0.28));
}

body.dark-mode .login-hero-image.animate {
    filter: grayscale(1) drop-shadow(0 22px 36px rgba(0, 0, 0, 0.28));
}

body.dark-mode .login-hero:hover .login-hero-image.animate,
body.dark-mode .login-hero-image.animate:hover {
    filter: grayscale(1) drop-shadow(0 26px 46px rgba(0, 0, 0, 0.38));
}

@media (prefers-reduced-motion: reduce) {
    .login-hero-image,
    .login-hero-image.animate,
    .login-hero:hover .login-hero-image.animate,
    .login-hero-image.animate:hover {
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}

.login-title {
    color: var(--login-text) !important;
    letter-spacing: -0.02em;
    font-size: clamp(26px, 2.4vw, 34px) !important;
    margin-bottom: 22px !important;
}

.google-signin-section {
    margin-bottom: 18px !important;
}

/* "Don't have an account? Sign up" row */
.login-signup-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 25px;
    font-size: 13px;
    line-height: 1.35;
}

.login-signup-text {
    color: var(--login-muted-2);
    font-weight: 500;
}

.login-signup-link {
    color: var(--login-accent);
    font-weight: 700;
    text-decoration: none;
}

.login-signup-link:hover {
    text-decoration: underline;
}

/* Google button (id must stay) */
#google_login_button.google-signin-btn,
.google-signin-btn {
    display: flex !important;
    flex-direction: row !important; /* override legacy mobile rule */
    align-items: center !important;
    justify-content: center !important;
    gap: 10px !important;
    flex-wrap: nowrap !important; /* keep icon + text on one line */
    white-space: nowrap !important;
    border-radius: 12px !important;
    border: 1px solid var(--login-border) !important;
    background: rgba(255, 255, 255, 0.65) !important;
    color: var(--login-text) !important;
    font-size: 15px !important;
    font-weight: 400 !important;
    padding: 12px 16px !important;
    box-shadow: 0 10px 26px rgba(15, 23, 42, 0.10);
    position: relative;
    overflow: hidden !important; /* prevent content overflow */
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}

/* Keep wrapper in a single row too (override legacy mobile rule) */
.google-btn-wrapper {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: center !important;
}

/* Prevent wrapping inside the button on small screens */
.google-signin-btn .google-icon,
.google-signin-btn img.google-icon {
    flex: 0 0 auto !important;
    width: 20px !important;
    height: 20px !important;
    min-width: 20px !important;
    max-width: 20px !important;
    flex-shrink: 0 !important;
    object-fit: contain;
}

.google-signin-btn span {
    display: inline-block !important;
    white-space: nowrap !important;
    flex-shrink: 1 !important; /* allow slight shrink if absolutely necessary */
    overflow: visible !important;
    text-overflow: clip !important;
    max-width: none !important;
    min-width: 0 !important;
}

/* Ensure Google button is never hidden by legacy rules */
#google_login_button {
    display: flex !important;
}

@media (max-width: 420px) {
    #google_login_button.google-signin-btn,
    .google-signin-btn {
        padding: 10px 12px !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        gap: 8px !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        width: 100% !important;
        min-width: 0 !important;
        box-sizing: border-box !important;
        flex-direction: row !important;
    }
    
    .google-signin-btn .google-icon,
    .google-signin-btn img.google-icon {
        width: 18px !important;
        height: 18px !important;
        min-width: 18px !important;
        max-width: 18px !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        object-fit: contain;
    }
    
    .google-signin-btn span {
        white-space: nowrap !important;
        flex-shrink: 1 !important;
        flex-grow: 0 !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        line-height: 1.2 !important;
        overflow: visible !important;
    }
}

/* Extra small screens - further reduce if needed */
@media (max-width: 360px) {
    #google_login_button.google-signin-btn,
    .google-signin-btn {
        padding: 8px 10px !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        gap: 6px !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
        flex-direction: row !important;
    }
    
    .google-signin-btn .google-icon,
    .google-signin-btn img.google-icon {
        width: 16px !important;
        height: 16px !important;
        min-width: 16px !important;
        max-width: 16px !important;
        flex-shrink: 0 !important;
        flex-grow: 0 !important;
        object-fit: contain;
    }
    
    .google-signin-btn span {
        font-size: 15px !important;
        font-weight: 400 !important;
        white-space: nowrap !important;
        flex-shrink: 1 !important;
        flex-grow: 0 !important;
    }
}

/* Very small screens - ensure they stay together */
@media (max-width: 320px) {
    #google_login_button.google-signin-btn,
    .google-signin-btn {
        padding: 8px 8px !important;
        font-size: 15px !important;
        font-weight: 400 !important;
        gap: 5px !important;
        flex-wrap: nowrap !important;
        white-space: nowrap !important;
    }
    
    .google-signin-btn .google-icon,
    .google-signin-btn img.google-icon {
        width: 16px !important;
        height: 16px !important;
        flex-shrink: 0 !important;
    }
    
    .google-signin-btn span {
        font-size: 15px !important;
        font-weight: 400 !important;
        white-space: nowrap !important;
    }
}

body.dark-mode #google_login_button.google-signin-btn,
body.dark-mode .google-signin-btn {
    background: rgba(31, 41, 55, 0.65) !important;
    box-shadow: 0 14px 34px rgba(0, 0, 0, 0.35);
}

.google-signin-btn::after {
    content: "";
    position: absolute;
    inset: -2px;
    background: radial-gradient(120% 120% at 0% 0%, rgba(20, 184, 166, 0.18) 0%, rgba(255, 255, 255, 0) 55%);
    opacity: 0;
    transition: opacity 0.25s ease;
    pointer-events: none;
}

body.dark-mode .google-signin-btn::after {
    background: radial-gradient(120% 120% at 0% 0%, rgba(140, 180, 255, 0.18) 0%, rgba(31, 41, 55, 0) 55%);
}

.google-signin-btn:hover {
    transform: translateY(-1px);
    background: rgba(255, 255, 255, 0.85) !important;
    border-color: rgba(20, 184, 166, 0.35) !important;
}

body.dark-mode .google-signin-btn:hover {
    background: rgba(55, 65, 81, 0.70) !important;
    border-color: rgba(140, 180, 255, 0.35) !important;
}

.google-signin-btn:hover::after {
    opacity: 1;
}

.recommended-tag {
    background: linear-gradient(135deg, #111827 0%, #0b1220 100%) !important;
    border-radius: 999px !important;
    padding: 4px 10px !important;
}

body.dark-mode .recommended-tag {
    background: linear-gradient(135deg, rgba(140, 180, 255, 0.22) 0%, rgba(45, 212, 191, 0.18) 100%) !important;
    color: #f9fafb !important;
}

.google-info-banner {
    border-radius: 12px !important;
    border: 1px solid rgba(20, 184, 166, 0.18);
    background: rgba(20, 184, 166, 0.10) !important;
    color: var(--login-text) !important;
}

body.dark-mode .google-info-banner {
    border-color: rgba(140, 180, 255, 0.16);
    background: rgba(140, 180, 255, 0.10) !important;
}

.divider-line {
    background-color: var(--login-border) !important;
}

.divider-text {
    color: var(--login-muted-2) !important;
}

.form-label {
    color: var(--login-muted) !important;
}

.form-input {
    background: rgba(255, 255, 255, 0.70) !important;
    border-radius: 12px !important;
    border: 1px solid var(--login-border) !important;
    color: var(--login-text) !important;
}

body.dark-mode .form-input {
    background: rgba(31, 41, 55, 0.55) !important;
}

.form-input:focus {
    border-color: var(--login-accent) !important;
    box-shadow: 0 0 0 0.25rem var(--login-focus) !important;
}

.password-toggle-icon:hover {
    color: var(--login-accent) !important;
}

.password-info-text {
    color: var(--login-muted-2) !important;
}

.forgot-password-link {
    color: var(--login-accent) !important;
}

.forgot-password-link:hover {
    color: var(--login-accent-2) !important;
}

.signin-btn {
    border-radius: 12px !important;
    background: linear-gradient(135deg, var(--login-accent) 0%, var(--login-accent-2) 100%) !important;
    box-shadow: 0 16px 44px rgba(20, 184, 166, 0.26);
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

body.dark-mode .signin-btn {
    box-shadow: 0 16px 44px rgba(140, 180, 255, 0.20);
}

.signin-btn:hover {
    transform: translateY(-1px);
    filter: saturate(1.05);
}

@media (max-width: 768px) {
    .login-layout {
        grid-template-columns: 1fr;
        gap: 18px;
    }

    .login-hero {
        display: none;
    }

    .login-form-container {
        padding: 28px 18px !important;
        border-radius: 16px !important;
    }
}
