/* frontend/portal/css/style.css */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 20px;
}

.container {
    background: #fff;
    padding: 40px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    width: 100%;
    max-width: 400px;
    animation: slideIn 0.3s ease-out;
}

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

h2 {
    text-align: center;
    margin-bottom: 30px;
    color: #333;
    font-size: 28px;
}

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

label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
    font-size: 14px;
}

/* Tooltip & Info Icon styles */
.label-with-info {
    display: flex;
    align-items: center;
}

.info-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 16px;
    height: 16px;
    background-color: #764ba2;
    color: white;
    border-radius: 50%;
    font-size: 11px;
    margin-left: 8px;
    cursor: help;
    position: relative;
    font-weight: bold;
}

.info-icon::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 125%;
    left: 50%;
    transform: translateX(-50%);
    background-color: #333;
    color: #fff;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: normal;
    width: 180px;
    visibility: hidden;
    opacity: 0;
    transition: opacity 0.3s, visibility 0.3s;
    z-index: 10;
    text-align: center;
    font-weight: normal;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.info-icon:hover::after {
    visibility: visible;
    opacity: 1;
}

.input-wrapper {
    position: relative;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    transition: all 0.3s ease;
}

input[type="text"]:focus,
input[type="password"]:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

input.error {
    border-color: #ef4444;
}

.error-message {
    color: #ef4444;
    font-size: 13px;
    margin-top: 5px;
    display: none;
}

.error-message.show {
    display: block;
}

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: #999;
    user-select: none;
}

.password-toggle:hover {
    color: #667eea;
}

button[type="submit"] {
    width: 100%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: transform 0.2s, box-shadow 0.2s;
    margin-top: 10px;
}

button[type="submit"]:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

button[type="submit"]:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.switch-form {
    text-align: center;
    margin-top: 20px;
    color: #666;
    font-size: 14px;
}

.switch-form a {
    color: #667eea;
    text-decoration: none;
    font-weight: 600;
}

.switch-form a:hover {
    text-decoration: underline;
}

.hidden {
    display: none;
}

.alert {
    padding: 12px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 14px;
    animation: slideDown 0.3s ease-out;
}

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

.alert.success {
    background-color: #d1fae5;
    color: #065f46;
    border: 1px solid #6ee7b7;
}

.alert.error {
    background-color: #fee2e2;
    color: #991b1b;
    border: 1px solid #fca5a5;
}

.loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-right: 8px;
}

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

.password-strength {
    height: 4px;
    background: #e0e0e0;
    border-radius: 2px;
    margin-top: 5px;
    overflow: hidden;
}

.password-strength-bar {
    height: 100%;
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* --- Password Requirements --- */
.password-requirements {
    background: rgb(241 235 174 / 30%);
    padding: 10px;
    margin-top: 8px;
    border-radius: 4px;
    font-size: 0.8rem;
    color: #7c94ae;
}

.password-requirements p {
    margin: 0 0 5px 0;
    font-weight: bold;
    color: #7c94ae;
}

.password-requirements ul {
    margin: 0;
    padding-left: 20px;
}

.password-requirements li {
    margin-bottom: 2px;
}

/* Hide by default */
#requirements-container {
    display: none;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #555;
    animation: fadeIn 0.3s ease-in-out;
}

/* Show class to be toggled by JS */
#requirements-container.visible {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============================================================================
 * ISSUE 1: PASSWORD REQUIREMENT STATUS STYLES
 * ============================================================================
 * Append these styles to the END of frontend/portal/css/style.css
 * (after the existing #requirements-container.visible block)
 *
 * These classes control the visual state of each password requirement
 * as the user types. Three states: pending (gray), met (green), unmet (red).
 * ============================================================================ */

/* --- Requirement Status States --- */

/* Base requirement style - controls transition animation */
.requirement {
    transition: color 0.2s ease, opacity 0.2s ease;
    list-style: none;           /* Remove default bullet - we use status icons instead */
    margin-left: -20px;         /* Compensate for removed bullet indent */
    padding: 2px 0;
}

/* Status icon sits before the requirement text */
.req-status {
    display: inline-block;
    width: 16px;
    text-align: center;
    margin-right: 4px;
    font-weight: bold;
    transition: color 0.2s ease;
}

/* PENDING: Not yet checked (user hasn't typed anything) */
.requirement-pending {
    color: #7c94ae;             /* Matches existing password-requirements text color */
}

.requirement-pending .req-status {
    color: #7c94ae;
}

/* MET: Requirement satisfied (green checkmark) */
.requirement-met {
    color: #22c55e;             /* Green - matches password-strength-bar max color */
}

.requirement-met .req-status {
    color: #22c55e;
}

/* UNMET: Requirement not satisfied (red X) */
.requirement-unmet {
    color: #ef4444;             /* Red - matches existing .alert.error color */
}

.requirement-unmet .req-status {
    color: #ef4444;
}