* {
    box-sizing: border-box;
}

body {
    font-family: 'Open Sans', sans-serif;
    margin: 0;
    min-height: 100vh;
    background: linear-gradient(to right, #0d2847 0%, #0d2847 35%, #4a90c8 60%, #b8d4e8 85%, #e8f2f7 100%);
    background-color: #0d2847;
    color: #333;
}

/* Exact background image (realm-login-background.png in portal/images/login) */
body.login-with-bg-image {
    background: url(../images/login/realm-login-background.png) no-repeat center center;
    background-size: cover;
}

.login-layout {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.login-main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

/* Centered login card */
#login-page-wrap {
    width: 100%;
    max-width: 560px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.login-card-brand {
    text-align: center;
    margin-bottom: 28px;
}

.login-card-brand .brand-logo--card {
    display: block;
    max-width: min(100%, 340px);
    width: 100%;
    height: auto;
    margin: 0 auto;
}

.brand-fallback--card {
    font-size: 1.75rem;
    font-weight: 700;
    color: #0d2847;
    margin-bottom: 8px;
}

.login-page-footer {
    flex-shrink: 0;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 1.25rem 1.75rem;
    padding: 12px 20px 28px;
    font-size: 14px;
    line-height: 1.5;
}

.login-page-footer a {
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

.login-page-footer a:hover {
    color: #e8f2f7;
    text-decoration: none;
}

#container {
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08), 0 12px 40px rgba(0, 123, 255, 0.12);
    padding: 40px 36px;
    width: 100%;
    max-width: 520px;
    text-align: left;
    width: 100%;
}

#container .form-table {
    width: 100%;
    border-collapse: collapse;
}

#container .form-table td {
    padding: 8px 0;
    vertical-align: top;
}

#container .form-table .label-cell {
    padding-bottom: 4px;
    font-size: 14px;
    color: #444;
    font-weight: 700;
}

#container input[type="text"],
#container input[type="password"] {
    width: 100%;
    padding: 12px 14px;
    padding-right: 52px; /* space for "show" in password field */
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    color: #333;
    font-size: 15px;
    font-family: inherit;
    margin: 0;
    display: block;
}

#container input::placeholder {
    color: #999;
}

#container input:focus {
    outline: none;
    border-color: #4a90c8;
}

/* Password row: wrapper for input + "show" link */
.password-row .input-cell {
    position: relative;
}

.password-wrapper {
    position: relative;
    width: 100%;
    display: block;
}

.password-wrapper input {
    padding-right: 60px;
}

.show-password-link {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 13px;
    color: #888;
    background: none;
    border: none;
    cursor: pointer;
    text-decoration: none;
    padding: 0;
}

.show-password-link:hover {
    color: #0d2847;
    text-decoration: underline;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    margin: 0;
}

.password-toggle img {
    width: 20px !important;
    height: auto !important;
    vertical-align: middle;
}

#changePassLink td {
    text-align: center;
}

#changePassLink table {
    width: auto;
    margin: 0 auto;
}

#changePassLink a {
    font-size: 13px;
    color: #333;
    text-decoration: underline;
    font-weight: 500;
}

#changePassLink a:hover {
    color: #007bff;
}

/* Submit */
#container input[type="submit"] {
    width: 100%;
    max-width: 200px;
    margin: 24px auto 16px;
    display: block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    background: #007bff;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-family: inherit;
}

#container input[type="submit"]:hover {
    background: #0056b3;
}

#container #ssoAndRequestAccessRow td {
    padding: 4px 0;
    font-size: 14px;
    color: #333;
    text-align: center;
    white-space: normal;
}

#container #ssoAndRequestAccessRow a {
    color: #007bff;
    text-decoration: underline;
    font-weight: 700;
}

#container #ssoAndRequestAccessRow a:hover {
    color: #0056b3;
}

/* Error row */
#errorRow td {
    padding: 8px 0;
    text-align: center;
}

#errorRow span {
    color: #c00;
    font-size: 14px;
}

/* Change / confirm password inline fields (same card style) */
#container .password-wrapper input[name="newPassword"],
#container .password-wrapper input[name="confirmPassword"] {
    padding-right: 48px;
}

/* Delete account page */
.delete-account-heading {
    margin: 0 0 12px;
    font-size: 1.35rem;
    font-weight: 700;
    color: #0d2847;
}

.delete-account-intro {
    margin: 0 0 20px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
}

.delete-account-container .accept-row td {
    padding-top: 12px;
    padding-bottom: 4px;
}

.delete-note-row td {
    padding-top: 12px !important;
    padding-bottom: 6px !important;
}

.delete-note-box {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    border: 1px solid #efd489;
    background: #fff9e8;
    border-radius: 8px;
    color: #5f4a1c;
    font-size: 14px;
    line-height: 1.5;
    padding: 12px 14px;
}

.delete-note-icon {
    flex-shrink: 0;
    line-height: 0;
    margin-top: 1px;
}

.delete-note-icon svg {
    display: block;
}

.delete-note-body {
    flex: 1;
    min-width: 0;
}

.delete-note-title {
    font-weight: 700;
}

.accept-delete-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-size: 14px;
    color: #333;
    cursor: pointer;
    font-weight: 600;
}

.accept-delete-label input[type="checkbox"] {
    margin-top: 3px;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    cursor: pointer;
}

#container input.delete-account-submit {
    max-width: 100%;
    background: #007bff;
}

#container input.delete-account-submit:hover {
    background: #0056b3;
}

#container input.delete-account-submit:disabled {
    background: #9bbce0;
    color: #f0f4f8;
    cursor: not-allowed;
}

#container input.delete-account-submit:disabled:hover {
    background: #9bbce0;
}

#infoRow td {
    padding: 8px 0;
    text-align: center;
}

#infoRow span,
.delete-account-info-cell span {
    color: #0d5c2e;
    font-size: 14px;
}

.delete-account-back-cell {
    text-align: center;
    padding-top: 8px !important;
}

.delete-account-back-cell a {
    font-size: 13px;
    color: #007bff;
    font-weight: 600;
    text-decoration: underline;
}

.delete-account-back-cell a:hover {
    color: #0056b3;
}

/* Mobile: tighter padding */
@media (max-width: 768px) {
    .login-main {
        padding: 16px;
    }

    #container {
        padding: 28px 24px;
    }
}
