/* ==========================================================================
   Google-Style 2-Step Login — JIM Student Journal Theme
   ========================================================================== */

.page_login {
    background: #f0f4f9;
    min-height: calc(100vh - 200px);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 32px 16px 48px;
}

/* Hide legacy elements on login page */
.page_login > h1,
.page_login > p:not(.g-login-notice),
.page_login > .cmp_breadcrumbs {
    display: none !important;
}

/* ── Login Card Wrapper ── */
.g-login-card {
    position: relative;
    width: 100%;
    max-width: 448px;
    background: #ffffff;
    border: 1px solid #dadce0;
    border-radius: 28px;
    box-shadow: 0 4px 24px rgba(18, 51, 84, 0.07);
    padding: 40px;
    box-sizing: border-box;
    overflow: hidden;
    transition: box-shadow 0.3s ease;
}

.g-login-card:hover {
    box-shadow: 0 8px 32px rgba(18, 51, 84, 0.1);
}

/* ── Top Progress Bar (Google indeterminate) ── */
.g-card-progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: #e8f0fe;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s;
    z-index: 10;
}

.g-card-progress.active {
    opacity: 1;
    visibility: visible;
}

.g-card-progress-bar {
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, #006F68, #25B879, #006F68);
    background-size: 200% 100%;
    animation: gLinearIndeterminate 1.4s infinite cubic-bezier(0.65, 0.815, 0.735, 0.395);
}

@keyframes gLinearIndeterminate {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* ── Card Header & Branding ── */
.g-login-header {
    margin-bottom: 28px;
    text-align: left;
}

.g-login-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    margin-bottom: 16px;
}

.g-login-logo img {
    height: 38px;
    width: auto;
    object-fit: contain;
}

.g-login-logo .g-brand-badge {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: #006F68;
    background: #DDF5EC;
    padding: 4px 10px;
    border-radius: 9999px;
    text-transform: uppercase;
}

.g-login-title {
    font-size: 26px;
    font-weight: 500;
    color: #1f1f1f;
    line-height: 1.25;
    margin: 0 0 8px 0;
    letter-spacing: -0.2px;
}

.g-login-subtitle {
    font-size: 15px;
    color: #444746;
    margin: 0;
    line-height: 1.45;
}

/* ── Interactive User Chip on Step 2 ── */
.g-user-chip {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 4px 14px 4px 6px;
    background: #f8fafd;
    border: 1px solid #dadce0;
    border-radius: 9999px;
    cursor: pointer;
    margin-bottom: 24px;
    transition: all 0.2s ease;
    user-select: none;
    max-width: 100%;
}

.g-user-chip:hover {
    background: #eef3f8;
    border-color: #c0c4c9;
}

.g-user-chip:focus-visible {
    outline: 2px solid #006F68;
    outline-offset: 2px;
}

.g-chip-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #006F68;
    color: #ffffff;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-transform: uppercase;
}

.g-chip-info {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.g-chip-text {
    font-size: 14px;
    font-weight: 500;
    color: #1f1f1f;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.g-chip-subtext {
    font-size: 12px;
    color: #637D95;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.g-chip-arrow {
    width: 18px;
    height: 18px;
    color: #444746;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* ── Step Container & Transitions ── */
.g-step-container {
    position: relative;
    width: 100%;
}

.g-step {
    width: 100%;
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.g-step[style*="display: none"] {
    opacity: 0;
    transform: translateX(16px);
}

/* ── Google Outlined Text Fields ── */
.g-field {
    position: relative;
    margin-bottom: 20px;
    width: 100%;
}

.g-input-wrapper {
    position: relative;
    width: 100%;
}

.g-input {
    width: 100%;
    height: 54px;
    padding: 16px;
    font-size: 16px;
    font-family: inherit;
    color: #1f1f1f;
    background: transparent;
    border: 1px solid #747775;
    border-radius: 8px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.g-input:hover {
    border-color: #1f1f1f;
}

.g-input:focus {
    border: 2px solid #006F68;
    padding: 15px;
}

.g-input.has-error {
    border: 2px solid #b3261e !important;
    padding: 15px !important;
}

/* Floating Label */
.g-label {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 16px;
    color: #444746;
    pointer-events: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #ffffff;
    padding: 0 4px;
    line-height: 1;
}

.g-input:focus ~ .g-label,
.g-input:not(:placeholder-shown) ~ .g-label,
.g-input.active ~ .g-label {
    top: 0;
    font-size: 12px;
    font-weight: 500;
    color: #006F68;
}

.g-input.has-error ~ .g-label {
    color: #b3261e !important;
}

/* Password Toggle Icon */
.g-toggle-pwd {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #444746;
    padding: 8px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.g-toggle-pwd:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #1f1f1f;
}

/* Error Message Alert */
.g-error-alert {
    display: none;
    align-items: flex-start;
    gap: 8px;
    color: #b3261e;
    font-size: 13px;
    line-height: 1.35;
    margin-top: 6px;
    padding: 0 4px;
}

.g-error-alert.visible {
    display: flex;
}

.g-error-alert svg {
    flex-shrink: 0;
    margin-top: 1px;
    width: 16px;
    height: 16px;
}

/* ── Links & Helper Row ── */
.g-helper-links {
    margin-top: 8px;
    margin-bottom: 24px;
}

.g-link {
    color: #006F68;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    display: inline-block;
    transition: color 0.2s, text-decoration 0.2s;
}

.g-link:hover {
    color: #00564F;
    text-decoration: underline;
}

/* ── Remember Me Checkbox ── */
.g-checkbox-row {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 16px 0 24px 0;
    cursor: pointer;
    user-select: none;
}

.g-checkbox-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #006F68;
    cursor: pointer;
    border-radius: 3px;
}

.g-checkbox-label {
    font-size: 14px;
    color: #444746;
    cursor: pointer;
}

/* ── Bottom Actions Row ── */
.g-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 32px;
    gap: 16px;
}

.g-actions.single-right {
    justify-content: flex-end;
}

.g-btn-text {
    background: none;
    border: none;
    color: #006F68;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    padding: 10px 16px;
    border-radius: 9999px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.g-btn-text:hover {
    background: rgba(0, 111, 104, 0.08);
    color: #00564F;
}

.g-btn-primary {
    background: #006F68;
    color: #ffffff;
    border: none;
    font-size: 14px;
    font-weight: 500;
    font-family: inherit;
    padding: 10px 26px;
    border-radius: 9999px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 96px;
    min-height: 42px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
    transition: background 0.2s, box-shadow 0.2s, transform 0.1s;
}

.g-btn-primary:hover {
    background: #00564F;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.g-btn-primary:active {
    transform: scale(0.98);
}

.g-btn-primary:disabled {
    background: #8eaba8;
    cursor: not-allowed;
    box-shadow: none;
}

/* Circular Spinner */
.g-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #ffffff;
    border-radius: 50%;
    animation: gSpin 0.7s linear infinite;
}

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

/* Shake animation for invalid account */
@keyframes gShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-6px); }
    40%, 80% { transform: translateX(6px); }
}

.g-shake {
    animation: gShake 0.4s ease-in-out;
}

/* ── Footer note below card ── */
.g-login-footer-links {
    margin-top: 24px;
    display: flex;
    justify-content: center;
    gap: 20px;
    font-size: 13px;
    color: #637D95;
}

.g-login-footer-links a {
    color: #637D95;
    text-decoration: none;
}

.g-login-footer-links a:hover {
    color: #123354;
    text-decoration: underline;
}

/* ── Mobile Responsiveness ── */
@media (max-width: 480px) {
    .page_login {
        padding: 16px 12px 32px;
    }

    .g-login-card {
        padding: 28px 20px 24px;
        border-radius: 20px;
        box-shadow: none;
        border: 1px solid #e0e5eb;
    }

    .g-login-title {
        font-size: 22px;
    }

    .g-actions {
        margin-top: 24px;
    }
}
