html, body {
    height: 100%;
    margin: 0;
    padding: 0;
}
body{
    background: linear-gradient(to bottom, #eef6f5, #a6d0cb);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    display: flex;
    justify-content: center;
    overflow-x: hidden;
    overflow-y: auto;
    touch-action: manipulation;
}
.container {
    position: relative;
    width: 100%;
    max-width: 400px;
    padding: 20px;
    background: linear-gradient(to bottom, #eef6f5, #a6d0cb);
    display: flex;
    flex-direction: column;
    justify-content: top;
    align-items: center;
    gap:0;
}

.logo-container {
    height: 25%;
    display: flex;
    justify-content: center;
    align-items: center;
}

.logo {
    font-size: 2.6em;
    font-weight: 700;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    color: #2c5a52;
    letter-spacing: 2px;
    text-shadow: rgba(0, 0, 0, 0.1) 0px 2px 4px;
    margin: 0;
    text-align: center;
}
.logo::before {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, transparent, #65b0a5, transparent);
    width: 140%;
    position: relative;
    left: -20%;
    top: 10%;
}
.logo::after {
    content: "";
    display: block;
    height: 4px;
    background: linear-gradient(90deg, transparent, #65b0a5, transparent);
    width: 140%;
    position: relative;
    left: -20%;
    bottom: 0%;
}

.card {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
    padding: 36px 32px 28px;
    width: 100%;
    box-sizing: border-box;
}

.card-title {
    font-size: 1.15em;
    font-weight: 600;
    color: #3c6b64;
    margin: 0 0 24px 0;
    text-align: center;
}

.form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 16px;
}

.form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: #4d4d4d;
    margin-bottom: 6px;
}

.form-group input {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    color: #333;
    background: #f4f7f6;
    border: 1.5px solid #c8dbd8;
    border-radius: 8px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
}

.form-group input:focus {
    border-color: #65b0a5;
    box-shadow: 0 0 0 3px rgba(101, 176, 165, 0.2);
}

.login-button {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    background: linear-gradient(90deg, rgb(59, 141, 124), rgb(101, 176, 165));
    color: #ffffff;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    font-weight: 700;
    border: 2px solid #d8704d;
    border-radius: 8px;
    padding: 12px;
    margin-top: 8px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
}

.login-button:hover {
    background: linear-gradient(90deg, rgb(50, 120, 105), rgb(85, 158, 148));
}

.login-button:active {
    transform: scale(0.98);
}

.card-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
}

.card-links a {
    font-size: 0.82rem;
    color: #3c6b64;
    text-decoration: none;
    font-weight: 500;
    cursor: pointer;
    transition: color 0.15s ease;
}

.card-links a:hover {
    color: #65b0a5;
    text-decoration: underline;
}

.flash-message {
    border-radius: 8px;
    padding: 10px 14px;
    font-size: 0.88rem;
    margin-bottom: 16px;
    text-align: center;
    line-height: 1.5;
}

.flash-error,
.flash-message:not([class*="flash-"]) {
    background: #fdecea;
    color: #c0392b;
    border: 1px solid #f5c6cb;
}

.flash-success {
    background: #ecfdf5;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

/* Two-column row for name fields */
.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
    min-width: 0;
}

/* Textarea shares input styling */
.form-group textarea {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    font-size: 1rem;
    color: #333;
    background: #f4f7f6;
    border: 1.5px solid #c8dbd8;
    border-radius: 8px;
    padding: 10px 14px;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    box-sizing: border-box;
    width: 100%;
    resize: vertical;
    min-height: 76px;
}

.form-group textarea:focus {
    border-color: #65b0a5;
    box-shadow: 0 0 0 3px rgba(101, 176, 165, 0.2);
}

/* Card visibility toggle */
.card--hidden {
    display: none;
}

/* Centred variant for the single back-link row */
.card-links--center {
    justify-content: center;
}

/* ── Remember-me checkbox row ── */
.form-check {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: -4px 0 16px;
    padding-left: 5px; 
}
.form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: #65b0a5;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}
.form-check label {
    font-size: 0.85rem;
    color: #4d4d4d;
    cursor: pointer;
    user-select: none;
    margin: 0;
}

/* ── Password input with show/hide toggle ── */
.input-with-toggle {
    position: relative;
}
.input-with-toggle input {
    width: 100%;
    padding-right: 44px;
}
.password-toggle-btn {
    position: absolute;
    top: 50%;
    right: 6px;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border: none;
    background: transparent;
    color: #6b8580;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: color 0.15s ease, background 0.15s ease;
}
.password-toggle-btn:hover {
    color: #3c6b64;
    background: rgba(101, 176, 165, 0.12);
}
.password-toggle-btn:focus-visible {
    outline: 2px solid #65b0a5;
    outline-offset: 1px;
}
.password-toggle-btn svg {
    width: 18px;
    height: 18px;
    pointer-events: none;
}
/* Strikethrough line when the password is hidden */
.password-toggle-btn[data-visible="false"]::after {
    content: '';
    position: absolute;
    left: 50%;
    top: 50%;
    width: 22px;
    height: 2px;
    background: currentColor;
    border-radius: 1px;
    transform: translate(-50%, -50%) rotate(-45deg);
    pointer-events: none;
}

/* ── New-password requirements checklist ── */
.password-checklist {
    margin: -8px 0 16px;
    padding: 12px 14px;
    background: #f4f7f6;
    border: 1px solid #e0eae7;
    border-radius: 8px;
}
.password-checklist-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: #4d4d4d;
    margin: 0 0 8px;
}
.password-checklist-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.password-checklist-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    color: #888;
    transition: color 0.15s ease;
}
.password-checklist-item.valid {
    color: #15803d;
}
.password-checklist-item .icon-check { display: none; }
.password-checklist-item.valid .icon-x { display: none; }
.password-checklist-item.valid .icon-check { display: inline-block; }
.password-checklist-icon {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.icon-x { color: #c0392b; }
.icon-check { color: #15803d; }

/* ── Disabled submit state ── */
.login-button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    background: linear-gradient(90deg, #8aa8a4, #b3cdc8);
    border-color: #c8dbd8;
}
.login-button:disabled:hover {
    background: linear-gradient(90deg, #8aa8a4, #b3cdc8);
}
