/* =================================
   Claire de Londres — Login CSS
   Standalone stylesheet
   Shared by: login.php | forgot-password.php | password-reset.php | failed.php | alert.php
   ================================= */

/* ---------------------------------
   Variables
   --------------------------------- */
:root {
    --pink:      #A8256B;
    --pink-dark: #8B1A57;
    --grey:      #C5C5C5;
    --dark:      #242529;
    --white:     #ffffff;
    --font-body: Tahoma, Geneva, sans-serif;
}

/* ---------------------------------
   Reset & Base
   --------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    background-color: var(--pink);
    display: flex;
    align-items: flex-start;
    justify-content: center;
}

/* Login — constrain overflow and add top padding */
body:has(#login-page) {
    padding-top: calc(6vh + 20px);
    overflow: hidden;
}

/* Forgot Password / Alert — scrollable with top padding */
body:has(#forgot-page),
body:has(#alert-page) {
    padding: calc(6vh + 60px) 1.5rem 3rem;
    overflow: auto;
}

/* =================================
   Login Page — Single Screen
   ================================= */

#login-page {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 420px;
    padding: 0 1.5rem;
}

/* ---------------------------------
   Logo — fade in once, hold permanently
   --------------------------------- */
#login-logo {
    width: 325px;
    height: 325px;
    object-fit: contain;
    margin-bottom: 1.8rem;
    opacity: 0;
    animation: fadeIn 0.5s ease forwards;
}

/* ---------------------------------
   Login Form — hidden until JS adds .visible
   --------------------------------- */
.login-form {
    width: 100%;
    opacity: 0;
}

.login-form.visible {
    animation: fadeIn 0.6s ease forwards;
}

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

/* ---------------------------------
   Error Message
   --------------------------------- */
.login-error {
    width: 100%;
    padding: 0.75rem 1rem;
    margin-bottom: 1.2rem;
    background: rgba(0, 0, 0, 0.25);
    border-left: 3px solid var(--white);
    border-radius: 4px;
    font-size: 0.82rem;
    color: var(--white);
    font-family: var(--font-body);
    line-height: 1.5;
}

/* ---------------------------------
   Form Fields
   --------------------------------- */
.form-group {
    margin-bottom: 1.2rem;
}

.form-group label {
    display: block;
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--white);
    margin-bottom: 0.45rem;
}

.form-group input {
    width: 100%;
    padding: 0.85rem 1.2rem;
    border: none;
    border-radius: 4px;
    font-size: 0.95rem;
    font-family: var(--font-body);
    color: var(--dark);
    background: var(--white);
    outline: none;
    transition: box-shadow 0.25s ease;
}

.form-group input::placeholder {
    color: var(--grey);
}

.form-group input:focus {
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.5);
}

/* ---------------------------------
   Password Toggle Wrapper
   --------------------------------- */
.input-wrapper {
    position: relative;
    width: 100%;
}

.input-wrapper input {
    padding-right: 3rem; /* room for the icon */
}

.btn-toggle-password {
    position: absolute;
    top: 50%;
    right: 0.75rem;
    transform: translateY(-50%);
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.btn-toggle-password:hover {
    opacity: 1;
}

.btn-toggle-password img {
    width: 20px;
    height: 20px;
    display: block;
}

/* ---------------------------------
   CAPTCHA
   --------------------------------- */
.captcha-display {
    width: 100%;
    padding: 0.85rem 1.2rem;
    margin-bottom: 0.6rem;
    background: var(--white);
    border-radius: 4px;
    text-align: center;
    font-family: 'Courier New', monospace;
    font-size: 1.6rem;
    font-weight: 700;
    letter-spacing: 0.4em;
    color: var(--dark);
    user-select: none;
}

/* ---------------------------------
   Buttons — Login & Submit (alias)
   --------------------------------- */
.btn-login,
.btn-submit {
    width: 100%;
    padding: 0.95rem 1rem;
    margin-top: 0.5rem;
    background: var(--dark);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-family: var(--font-body);
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s ease, transform 0.15s ease;
}

.btn-login:hover,
.btn-submit:hover {
    background: #000000;
    transform: translateY(-1px);
}

.btn-login:active,
.btn-submit:active {
    transform: translateY(0);
}

/* ---------------------------------
   Forgot Password Link
   --------------------------------- */
.forgot-password {
    margin-top: 1.2rem;
    text-align: center;
}

.forgot-password a {
    font-size: 0.82rem;
    color: var(--white);
    text-decoration: none;
    font-family: var(--font-body);
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.forgot-password a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* =================================
   Forgot Password Page
   ================================= */

#forgot-page,
#alert-page {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    width: 100%;
    max-width: 420px;
}

/* ---------------------------------
   Page Title
   --------------------------------- */
.page-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 1.4rem;
    letter-spacing: 0.02em;
    line-height: 1.3;
}

/* ---------------------------------
   Intro Text
   --------------------------------- */
.intro-text {
    margin-bottom: 1.8rem;
}

.intro-text p {
    font-size: 0.88rem;
    color: var(--white);
    line-height: 1.65;
    margin-bottom: 0.8rem;
    opacity: 0.92;
}

.intro-text p:last-child {
    margin-bottom: 0;
}

.intro-text strong {
    color: var(--white);
    font-weight: 700;
}

/* ---------------------------------
   Forgot Form
   --------------------------------- */
.forgot-form {
    width: 100%;
}

/* ---------------------------------
   Back to Login
   --------------------------------- */
.back-to-login {
    margin-top: 1.4rem;
    width: 100%;
    text-align: center;
}

.back-to-login a {
    font-size: 0.82rem;
    color: var(--white);
    text-decoration: none;
    opacity: 0.85;
    transition: opacity 0.2s ease;
}

.back-to-login a:hover {
    opacity: 1;
    text-decoration: underline;
}

/* ---------------------------------
   Responsive
   --------------------------------- */
@media (max-width: 480px) {

    body:has(#login-page) {
        padding-top: calc(4vh + 20px);
    }

    body:has(#forgot-page),
    body:has(#alert-page) {
        padding-top: calc(4vh + 40px);
    }

    #login-logo {
        width: 240px;
        height: 240px;
    }
}
