/* ===========================
   ROOT VARIABLES & DYNAMIC SIZING
   =========================== */
:root {
    /* Fluid Typography using clamp() */
    --font-size-h1: clamp(32px, 5vw, 60px);
    --font-size-h2: clamp(28px, 4vw, 48px);
    --font-size-label: clamp(20px, 2.5vw, 30px);
    --font-size-input: clamp(16px, 1.8vw, 20px);
    --font-size-button: clamp(18px, 2vw, 24px);
    --font-size-link: clamp(14px, 1.5vw, 20px);

    /* Spacing */
    --spacing-xs: clamp(10px, 2vw, 20px);
    --spacing-sm: clamp(15px, 3vw, 30px);
    --spacing-md: clamp(20px, 4vw, 40px);
    --spacing-lg: clamp(30px, 5vw, 60px);

    /* Logo sizing */
    --logo-height: clamp(35px, 6vw, 50px);

    /* Hero image sizing */
    --hero-max-size: clamp(300px, 50vw, 70vh);

    /* Animated Circles - Responsive sizing */
    --circle-size-large: clamp(200px, 25vw, 400px);
    --circle-size-small: clamp(80px, 10vw, 150px);
}

/* ===========================
   AUTOFILL STYLES
   =========================== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active {
    transition: background-color 5000s ease-in-out 0s !important;
    color: inherit !important;
    border: 0px solid #ccc;
    border-radius: 0px;
    box-shadow: 3px 4px 0px #8CC63F;
    background-color: #F7F7F7!important;
}

input:focus {
    transition: background-color 5000s ease-in-out 0s !important;
    color: inherit !important;
    border: 0px solid #ccc;
    border-radius: 0px;
    background-color: #F7F7F7!important;
    outline: none !important;
    box-shadow: 3px 4px 0px #007932;
}

/* ===========================
   HERO LAYERS - ALL SAME SIZE, STACKED
   =========================== */
.hero-layers {
    position: relative;
    width: 100%;
    max-width: var(--hero-max-size);
    max-height: var(--hero-max-size);
    margin: 0 auto;
}

/* All layers have EXACTLY the same dimensions */
.hero-layer {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    pointer-events: none;
}

/* Layer 1: Background image */
.hero-layer.background {
    z-index: 1;
    position: relative; /* First layer sets the size */
}

/* Layer 2: Large light green circle (animated) - 75% of image size */
.hero-layer.circle-large {
    z-index: 2;
    border-radius: 50%;
    background-image: url('/public/images/wwf/wwf_texture_green_light.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.85;
    animation: floatingLarge 12s infinite ease-in-out;
    /* Size it properly - 75% of container (bigger) */
    width: 80%;
    height: 80%;
    top: 55%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Layer 3: Small dark green circle (animated) - 13% of image size */
.hero-layer.circle-small {
    z-index: 3;
    border-radius: 50%;
    background-image: url('/public/images/wwf/wwf_texture_green_dark.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    opacity: 0.85;
    animation: floatingSmall 8s infinite ease-in-out;
    width: 20%;
    height: 20%;
    top: 10%;
    left: 70%;
    transform: none;
}

/* Layer 4: Kati foreground image */
.hero-layer.foreground {
    z-index: 4;
}

/* Floating animation for large circle */
@keyframes floatingLarge {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(0deg) translate(-10px) rotate(0deg);
    }
    50% {
        transform: translate(-50%, -50%) rotate(180deg) translate(-10px) rotate(-180deg);
    }
}

/* Floating animation for small circle */
@keyframes floatingSmall {
    0%, 100% {
        transform: rotate(0deg) translate(-8px) rotate(0deg);
    }
    50% {
        transform: rotate(180deg) translate(-8px) rotate(-180deg);
    }
}

/* ===========================
   HEADER
   =========================== */
header {
    position: fixed;
    top: var(--spacing-sm);
    left: var(--spacing-sm);
    width: 100%;
    padding: 10px 20px;
    background: transparent;
    z-index: 999;
}

.logo img {
    height: var(--logo-height);
    width: auto;
    display: block;
}

/* ===========================
   LOGIN CONTAINER - MODERN FLEXBOX LAYOUT
   =========================== */
.login-container {
    position: relative;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
    padding-top: calc(var(--logo-height) + var(--spacing-lg));
    z-index: 2;
}

.login-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    width: 100%;
    max-width: 1400px;
    position: relative;
    z-index: 2;
}

/* ===========================
   HERO SECTION
   =========================== */
.login-hero-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.login-hero {
    object-fit: contain;
    max-height: var(--hero-max-size);
    max-width: var(--hero-max-size);
    width: 100%;
    height: auto;
}

/* ===========================
   FORM SECTION
   =========================== */
.login-form-section {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.login-form {
    width: 100%;
    max-width: 600px;
}

.login-form h1 {
    font-size: var(--font-size-h1);
    line-height: 1.2;
    padding-bottom: var(--spacing-md);
    margin: 0;
}

.login-form label {
    font-size: var(--font-size-label);
    line-height: normal;
    display: block;
}

.login-form input {
    width: 100%;
    font-family: "Open Sans";
    padding: var(--spacing-xs);
    margin-top: var(--spacing-xs);
    margin-bottom: var(--spacing-md);
    font-size: var(--font-size-input);
    border: 0px solid #ccc;
    border-radius: 0px;
    box-shadow: 3px 4px 0px #8CC63F;
    background-color: #F7F7F7!important;
}

.login-form .button {
    margin-top: var(--spacing-sm);
    margin-left: 0;
    font-size: var(--font-size-button);
    padding: clamp(8px, 1.5vw, 15px) clamp(15px, 3vw, 25px);
}

.forgotpassword {
    margin-top: var(--spacing-md);
}

.forgotpassword label,
.forgotpassword a,
.forgotpassword a:visited,
.forgotpassword a:hover,
.forgotpassword a:active {
    font-size: var(--font-size-link);
    color: #007932;
    text-decoration: underline;
}

/* ===========================
   TABLET LANDSCAPE (1024px - 1366px)
   =========================== */
@media (max-width: 1366px) and (orientation: landscape) {
    .login-content {
        gap: var(--spacing-md);
    }

    .login-hero {
        max-height: 60vh;
        max-width: 60vh;
    }
}

/* ===========================
   TABLET PORTRAIT (768px - 1024px)
   =========================== */
@media (max-width: 1024px) and (orientation: portrait) {
    .login-content {
        flex-direction: column;
        gap: var(--spacing-md);
    }

    .login-hero-section,
    .login-form-section {
        flex: none;
        width: 100%;
        padding: var(--spacing-sm);
    }

    .login-hero {
        max-height: 40vh;
        max-width: 40vh;
    }

    .login-form {
        max-width: 500px;
    }
}

/* ===========================
   TABLET LANDSCAPE (768px - 1024px)
   =========================== */
@media (max-width: 1024px) and (orientation: landscape) {
    :root {
        --font-size-h1: clamp(28px, 4vw, 48px);
        --spacing-xs: clamp(5px, 1vw, 10px);
        --spacing-sm: clamp(8px, 1.5vw, 15px);
        --spacing-md: clamp(10px, 2vw, 20px);
        --spacing-lg: clamp(15px, 2.5vw, 25px);
    }

    .login-container {
        padding: var(--spacing-sm);
        padding-top: calc(var(--logo-height) + var(--spacing-md));
    }

    .login-content {
        gap: var(--spacing-sm);
    }

    .login-hero-section,
    .login-form-section {
        padding: var(--spacing-sm);
    }

    .login-hero {
        max-height: 50vh;
        max-width: 50vh;
    }

    .login-form input {
        margin-bottom: var(--spacing-sm);
    }

    .login-form h1 {
        padding-bottom: var(--spacing-sm);
    }
}

/* ===========================
   MOBILE LANDSCAPE (481px - 767px)
   =========================== */
@media (max-width: 767px) and (orientation: landscape) {
    :root {
        --font-size-h1: clamp(24px, 3.5vw, 36px);
        --spacing-md: clamp(10px, 2vw, 20px);
    }

    .login-container {
        padding: var(--spacing-sm);
        padding-top: calc(var(--logo-height) + var(--spacing-sm));
    }

    .login-content {
        flex-direction: row;
        gap: var(--spacing-sm);
    }

    .login-hero-section {
        flex: 0.8;
    }

    .login-hero {
        max-height: 60vh;
        max-width: 35vw;
    }

    .login-form {
        max-width: 100%;
    }

    .login-form input {
        margin-bottom: var(--spacing-sm);
    }

    header {
        top: 10px;
        left: 10px;
    }
}

/* ===========================
   MOBILE PORTRAIT (max 767px)
   =========================== */
@media (max-width: 767px) and (orientation: portrait) {
    :root {
        --font-size-h1: clamp(26px, 6vw, 40px);
        --font-size-label: clamp(18px, 4vw, 24px);
        --spacing-lg: clamp(20px, 4vw, 40px);
    }

    .login-container {
        padding: var(--spacing-sm);
        padding-top: calc(var(--logo-height) + var(--spacing-lg));
    }

    .login-content {
        flex-direction: column;
        gap: var(--spacing-sm);
    }

    .login-hero-section {
        padding: var(--spacing-xs);
    }

    .login-hero {
        max-height: 30vh;
        max-width: 70vw;
    }

    .login-form-section {
        padding: var(--spacing-xs);
    }

    .login-form {
        max-width: 100%;
    }

    .login-form h1 {
        text-align: center;
    }

    header {
        top: 15px;
        left: 15px;
    }
}

/* ===========================
   SMALL MOBILE (max 480px)
   =========================== */
@media (max-width: 480px) {
    :root {
        --font-size-h1: clamp(22px, 5.5vw, 32px);
        --font-size-label: clamp(16px, 3.5vw, 20px);
        --font-size-input: clamp(14px, 3vw, 16px);
        --font-size-button: clamp(16px, 3.5vw, 20px);
        --spacing-xs: 8px;
        --spacing-sm: 12px;
        --spacing-md: 16px;
        --spacing-lg: 24px;
        --logo-height: clamp(30px, 8vw, 40px);
    }

    .login-container {
        padding: 15px;
        padding-top: calc(var(--logo-height) + 30px);
    }

    .login-hero {
        max-height: 25vh;
        max-width: 80vw;
    }

    .login-form input {
        padding: 12px;
    }

    .login-form .button {
        width: 100%;
        padding: 12px 20px;
        margin: 0;
        margin-top: var(--spacing-sm);
    }

    header {
        top: 10px;
        left: 10px;
    }

    .logo img {
        height: var(--logo-height);
    }
}

/* ===========================
   VERY SMALL MOBILE (max 375px)
   =========================== */
@media (max-width: 375px) {
    :root {
        --font-size-h1: clamp(20px, 5vw, 28px);
        --logo-height: 30px;
    }

    .login-hero {
        max-height: 20vh;
    }
}

/* ===========================
   LEGACY STYLES (kept for compatibility)
   =========================== */
.auth-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    min-width: 100%;
    min-height: 100vh;
}

.auth-wrapper .auth-content {
    position: relative;
    width: 390px;
    padding: 15px;
}

.auth-wrapper .auth-bg .r {
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
}

.auth-wrapper .auth-bg .r:first-child {
    top: 100px;
    left: 100px;
    background-image: url('/public/images/wwf/wwf_texture_green_dark.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-wrapper .auth-bg .r.s:nth-child(2) {
    top: 150px;
    right: -150px;
    background-image: url('/public/images/wwf/wwf_texture_green_light.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-wrapper .auth-bg .r.s:nth-child(3) {
    left: -150px;
    bottom: 150px;
    background-image: url('/public/images/wwf/wwf_texture_green_dark.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.auth-wrapper .auth-bg .r:nth-child(odd) {
    animation: floating 7s infinite;
}

.auth-wrapper .auth-bg .r:nth-child(even) {
    animation: floating 9s infinite;
}

@keyframes floating {
    from {
        transform: rotate(0deg) translate(-10px) rotate(0deg);
    }
    to {
        transform: rotate(360deg) translate(-10px) rotate(-360deg);
    }
}