/* =============================================================================
   Custom Login Page — login.css
   local_customlogin plugin
   ============================================================================= */

/* ── CSS Variables ─────────────────────────────────────────────────────────── */
:root {
    --color-iws-navy:  #0a192f;
    --color-iws-ocean: #112240;
    --color-iws-sky:   #233554;
    --color-iws-mist:  #a8b2d1;
    --color-iws-light: #e6f1ff;
}

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

html, body {
    width: 100%;
    height: 100%;
    background-color: var(--color-iws-navy);
    color: var(--color-iws-light);
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    overflow: hidden;
}

/* ── Keyframe Animations ───────────────────────────────────────────────────── */
@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

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

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.5; }
}

@keyframes float {
    0%,  100% { transform: translateY(0px)   rotate(0deg);   }
    25%        { transform: translateY(-10px) rotate(0.5deg); }
    50%        { transform: translateY(-6px)  rotate(-0.2deg); }
    75%        { transform: translateY(-8px)  rotate(0.3deg); }
}

@keyframes floatSeagull {
    0%, 100% { transform: translateY(0px);  }
    50%       { transform: translateY(-15px); }
}

@keyframes arrowBounce {
    0%, 100% { transform: translateX(0px);  }
    50%       { transform: translateX(15px); }
}

@keyframes loading {
    0%   { width: 0%;   margin-left: 0;    }
    50%  { width: 70%;  margin-left: 0;    }
    100% { width: 0%;   margin-left: 100%; }
}

@keyframes waveMove {
    0%, 100% { transform: translateX(0%);  }
    50%       { transform: translateX(-5%); }
}

/* ── Loading Screen ────────────────────────────────────────────────────────── */
.cl-loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-iws-navy);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    z-index: 100;
    animation: fadeOut 0.8s ease-in-out 3s forwards;
    pointer-events: none;
}

.cl-loading-screen.hidden {
    display: none;
}

.cl-loading-screen img {
    width: 112px;
    height: 112px;
    object-fit: contain;
    animation: pulse 1.5s ease-in-out infinite;
}

.cl-loading-bar {
    width: 192px;
    height: 4px;
    background-color: rgba(255, 255, 255, 0.1);
    border-radius: 9999px;
    overflow: hidden;
}

.cl-loading-bar-inner {
    height: 100%;
    background-color: rgba(255, 255, 255, 0.6);
    border-radius: 9999px;
    animation: loading 1.5s ease-in-out infinite;
}

/* ── Main Container ────────────────────────────────────────────────────────── */
.cl-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    opacity: 0;
    animation: fadeIn 0.8s ease-in-out 3s forwards;
}

/* ── Background Layer ──────────────────────────────────────────────────────── */
.cl-background-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.cl-video-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cl-video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 1;
}

.cl-video-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(10, 25, 47, 0.3), transparent);
    z-index: 1;
}

.cl-ocean-base {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10;
    transition: transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cl-ocean-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 60%;
    background: linear-gradient(to top, #0f2a4a, rgba(26, 75, 119, 0.8), transparent);
}

.cl-waves {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background-image: url('https://www.transparenttextures.com/patterns/cubes.png');
    background-repeat: repeat;
    background-size: auto;
    opacity: 0.1;
    mix-blend-mode: overlay;
    animation: waveMove 10s ease-in-out infinite;
}

/* ── Content Wrapper ───────────────────────────────────────────────────────── */
.cl-content-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: row;
    z-index: 10;
}

/* ── Left Side: Storytelling ───────────────────────────────────────────────── */
.cl-left-side {
    position: relative;
    width: 65%;
    height: 100%;
    pointer-events: none;
}

.cl-scene-container {
    position: absolute;
    width: 100%;
    height: 100%;
}

/* Scene Images */
.cl-scene-image {
    position: absolute;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 20px 25px rgba(0, 0, 0, 0.3));
}

.cl-scene-image.active {
    opacity: 1;
}

.cl-scene-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: bottom;
    animation: float 6s ease-in-out infinite;
}

.cl-scene-image.scene-1 {
    bottom: -10%;
    /* left: -25%; */
    /* width: max(160vmin, 100%);
    height: max(160vmin, 100%); */
    max-width: 2000px;
    max-height: 2000px;
    right: -15%;
}

.cl-scene-image.scene-2 {
    /* bottom: -60%;*/
    left: -5%;
    /* width: max(140vmin, 100%);
    height: max(140vmin, 100%);  */
    max-width: 2000px;
    max-height: 2000px;
}

.cl-scene-image.scene-3 {
    bottom: -10%;
    left: -5%;
    /* width: max(140vmin, 100%);
    height: max(140vmin, 100%); */
    max-width: 2000px;
    max-height: 2000px;
}

.cl-scene-image.scene-4-mascot {
    bottom: -50%;
    /* width: max(140vmin, 100%);
    height: max(140vmin, 100%); */
    max-width: 2000px;
    max-height: 2000px;
    bottom: -50%;
    left: -10%;
    right: -25%;
}

/* Horizon Image */
.cl-horizon-image {
    position: absolute;
    top: 32%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 20;
    width: max(20vmin, 100%);
    max-width: 2000px;
    opacity: 0;
    transition: opacity 2s cubic-bezier(0.4, 0, 0.2, 1), transform 2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cl-horizon-image.active {
    opacity: 1;
}

.cl-horizon-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    opacity: 0.85;
    animation: float 8s ease-in-out infinite;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

/* Seagull Image */
.cl-seagull-image {
    position: absolute;
    top: 15%;
    right: 10%;
    z-index: 20;
    width: 25vmin;
    max-width: 400px;
    opacity: 0;
    transition: opacity 1.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.cl-seagull-image.active {
    opacity: 1;
}

.cl-seagull-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    opacity: 0.9;
    animation: floatSeagull 4s ease-in-out infinite;
    filter: drop-shadow(0 10px 15px rgba(0, 0, 0, 0.2));
}

/* Story Text Overlays */
.cl-text-overlay {
    position: absolute;
    opacity: 0;
    transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 40;
    text-shadow: 0 4px 6px rgba(0, 0, 0, 0.3);
}

.cl-text-overlay.active {
    opacity: 1;
}

.cl-text-overlay-1 {
    bottom: 30%;
    left: 15%;
    max-width: 32rem;
}

.cl-text-overlay-1 h3 {
    font-size: 2rem;
    font-weight: 600;
    color: white;
    letter-spacing: -0.02em;
    margin-bottom: 0.25rem;
}

.cl-text-overlay-1 h1 {
    font-size: 4.5rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    margin-bottom: 0.5rem;
}

.cl-text-overlay-1 h4 {
    font-size: 1.5rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: 0.75rem;
}

.cl-text-overlay-1 .cl-underline {
    width: 75%;
    height: 4px;
    background: linear-gradient(to right, #fb923c, #f97316, transparent);
    border-radius: 9999px;
    transform: rotate(-1deg);
    opacity: 0.9;
}
.cl-text-overlay-3 {
    top: 60%;
    left: 60%;
    transform: translate(-50%, -50%);
    max-width: 56rem;
    text-align: center;
    width: 100%;
    padding: 0 2rem;
}
.cl-text-overlay-4 {
    left: 75%;
    top: 60%;
    transform: translate(-50%, -50%);
    max-width: 56rem;
    text-align: center;
    width: 100%;
    padding: 0 2rem;
}
.cl-text-overlay-2 {
    top: 35%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 56rem;
    text-align: center;
    width: 100%;
    padding: 0 2rem;
}

.cl-text-overlay-2 h2,
.cl-text-overlay-3 h2,
.cl-text-overlay-4 h2 {
    font-family: 'Playfair Display', ui-serif, Georgia, serif;
    font-size: 3rem;
    font-weight: 500;
    color: white;
    line-height: 1.3;
}

.cl-text-overlay-4 p {
    margin-top: 1.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1.125rem;
    font-weight: 300;
    letter-spacing: 0.05em;
}

.cl-login-arrow {
    margin-top: 1.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    color: #fbbf24;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.875rem;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
}

.cl-login-arrow .cl-arrow-bounce {
    display: inline-block;
    animation: arrowBounce 1.5s ease-in-out infinite;
}

/* Scene Indicators (Dots) */
.cl-scene-indicators {
    position: absolute;
    bottom: 32px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 50;
    display: flex;
    gap: 0.75rem;
    pointer-events: auto;
}

.cl-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.3);
    cursor: pointer;
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    border: none;
    padding: 0;
    /* Reset generic button styles */
    display: block;
    box-shadow: none;
}

.cl-dot.active {
    background-color: white;
    transform: scale(1.5);
    box-shadow: 0 0 10px rgba(255, 255, 255, 0.8);
}

.cl-dot:hover {
    background-color: rgba(255, 255, 255, 0.6);
    transform: none;
}

.cl-dot.active:hover {
    transform: scale(1.5);
}

/* ── Right Side: Login Form ────────────────────────────────────────────────── */
.cl-right-side {
    position: relative;
    width: 35%;
    height: 100%;
    z-index: 50;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    pointer-events: auto;
}

.cl-form-container {
    width: 100%;
    max-width: 28rem;
    padding: 2.5rem;
    border-radius: 2rem;
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

/* Logo Area */
.cl-logo-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 1rem;
    margin-bottom: 2rem;
}

.cl-logo-area img {
    width: 128px;
    height: 128px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0, 0, 0, 0.2));
    margin-bottom: 0.5rem;
}

.cl-logo-area h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: white;
    letter-spacing: -0.02em;
    margin: 0;
}

.cl-logo-area p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 0.5rem;
    font-weight: 300;
}

/* Error Message */
.cl-error-msg {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    border-radius: 0.75rem;
    padding: 0.75rem 1rem;
    color: #fca5a5;
    font-size: 0.875rem;
    margin-bottom: 1.25rem;
    line-height: 1.4;
}

.cl-error-msg svg {
    flex-shrink: 0;
}

/* Form */
.cl-login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.cl-form-group {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
}

.cl-form-label-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-left: 0.25rem;
}

.cl-form-label-row label,
.cl-form-group > label {
    font-size: 0.875rem;
    font-weight: 500;
    color: white;
    margin-left: 0.25rem;
}

.cl-form-label-row a,
.cl-form-group a {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    transition: color 0.2s;
}

.cl-form-label-row a:hover,
.cl-form-group a:hover {
    color: white;
}

/* Input Wrapper */
.cl-input-wrapper {
    position: relative;
}

.cl-input-icon {
    position: absolute;
    top: 0;
    left: 1rem;
    height: 100%;
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.5);
    pointer-events: none;
    transition: color 0.2s;
}

.cl-input-wrapper:focus-within .cl-input-icon {
    color: white;
}

.cl-input-wrapper input {
    width: 100%;
    padding: 0.875rem 1rem 0.875rem 2.75rem;
    background-color: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 0.75rem;
    color: white;
    font-size: 1rem;
    backdrop-filter: blur(4px);
    transition: all 0.2s;
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
    -webkit-appearance: none;
    appearance: none;
}

/* Password field gets extra right padding for the eye button */
.cl-input-wrapper input[type="password"],
.cl-input-wrapper input.cl-has-toggle {
    padding-right: 3rem;
}

.cl-input-wrapper input::placeholder {
    color: rgba(255, 255, 255, 0.3);
}

.cl-input-wrapper input:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.3);
    border-color: transparent;
}

/* Password Toggle Button (Eye Icon) */
.cl-password-toggle {
    position: absolute;
    top: 0;
    right: 0.75rem;
    height: 100%;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    width: auto;
    margin: 0;
    box-shadow: none;
    border-radius: 0;
    transition: color 0.2s;
    /* Prevent text-select on double-click */
    user-select: none;
    -webkit-user-select: none;
}

.cl-password-toggle:hover {
    background: none;
    color: white;
    transform: none;
    box-shadow: none;
}

.cl-password-toggle:active {
    transform: none;
}

.cl-password-toggle:focus {
    outline: none;
    color: white;
}

/* Submit Button */
.cl-submit-btn {
    width: 100%;
    padding: 1rem;
    margin-top: 0.5rem;
    background-color: white;
    color: var(--color-iws-navy);
    font-weight: 700;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.2);
    font-family: 'Inter', ui-sans-serif, system-ui, sans-serif;
}

.cl-submit-btn:hover {
    background-color: #f3f4f6;
    transform: scale(1.02);
}

.cl-submit-btn:active {
    transform: scale(0.98);
}

.cl-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.cl-btn-loading {
    display: none;
}

.cl-submit-btn.loading .cl-btn-text,
.cl-submit-btn.loading .cl-btn-arrow {
    display: none;
}

.cl-submit-btn.loading .cl-btn-loading {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}

/* Loading spinner for submit */
@keyframes spin {
    to { transform: rotate(360deg); }
}

.cl-spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(10, 25, 47, 0.3);
    border-top-color: var(--color-iws-navy);
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .cl-left-side {
        width: 100%;
        height: 60%;
    }

    .cl-right-side {
        width: 100%;
        height: 40%;
        padding: 1.5rem;
    }

    .cl-content-wrapper {
        flex-direction: column;
    }

    .cl-scene-image.scene-1 {
        width: max(160vmin, 100%);
        height: max(160vmin, 100%);
    }

    .cl-text-overlay-1 h3 {
        font-size: 1.5rem;
    }

    .cl-text-overlay-1 h1 {
        font-size: 3.5rem;
    }

    .cl-text-overlay-1 h4 {
        font-size: 1.25rem;
    }

    .cl-text-overlay-2 h2,
    .cl-text-overlay-3 h2,
    .cl-text-overlay-4 h2 {
        font-size: 2rem;
    }

    .cl-seagull-image {
        top: 20%;
        right: 20%;
        width: 30vmin;
    }

    .cl-horizon-image {
        top: 27%;
        width: max(150vmin, 100%);
    }
}

@media (max-width: 768px) {
    .cl-form-container {
        padding: 1.5rem;
    }

    .cl-text-overlay-1 {
        left: 10%;
    }

    .cl-input-wrapper input,
    .cl-submit-btn {
        font-size: 16px; /* Prevent iOS auto-zoom */
    }
}
