/* ==========================================================================
   Login Page Extensions (login.css)
   Extends main.css - Only unique login components
   ========================================================================== */

/* ==========================================================================
   Dark Theme Override for Login
   ========================================================================== */
body {
    font-family: "Georgia", serif;
    background: #0a0a0a;
    color: #f0e6d2;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* ==========================================================================
   Shared Background & Particles (same as other pages)
   ========================================================================== */
.background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -2;
    background: linear-gradient(45deg, #1a0f1f, #2d1b3d, #1f2937, #0f172a);
    background-size: 400% 400%;
    animation: gradientShift 15s ease infinite;
}

@keyframes gradientShift {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
}

.particle {
    position: absolute;
    background: radial-gradient(circle, #ffd700, #ff6b35);
    border-radius: 50%;
    opacity: 0.6;
    animation: float 20s infinite ease-in-out;
}

@keyframes float {
    0%,
    100% {
        transform: translateY(100vh) translateX(0) scale(0);
        opacity: 0;
    }
    10%,
    90% {
        opacity: 0.6;
    }
    100% {
        transform: translateY(-100vh) translateX(100px) scale(1);
        opacity: 0;
    }
}

/* ==========================================================================
   Login Navigation Overrides
   ========================================================================== */
nav {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(10px);
}

nav:hover {
    background: rgba(0, 0, 0, 0.6);
}

/* Logo with Baybayin Animation */
.logo {
    font-size: 1.75rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    transition: transform 0.3s ease;
    position: relative;
    cursor: pointer;
    text-decoration: none;
}

.logo-baybayin {
    display: inline-block;
    transition: all 0.3s ease;
}

.logo-latin {
    position: absolute;
    left: 0;
    top: 0;
    opacity: 0;
    transition: all 0.3s ease;
    transform: translateY(5px);
}

.logo:hover .logo-baybayin {
    opacity: 0;
    transform: translateY(-5px);
}

.logo:hover .logo-latin {
    opacity: 1;
    transform: translateY(0);
}

.logo:hover {
    transform: scale(1.1);
}

/* Nav links dark theme override */
.nav-links a {
    color: #f0e6d2;
}

.nav-links a:hover {
    color: #ffd700;
    transform: translateY(-2px);
}

.nav-links a::after {
    background: #ffd700;
}

.nav-links a.active {
    color: #ffd700;
}

.nav-links a.active::after {
    width: 100%;
}

/* ==========================================================================
   Login Container
   ========================================================================== */
.login-container {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 30px;
    padding: 3.75rem 3.75rem 2.5rem 3.75rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    animation: loginEntrance 1s ease-out;
    margin-top: 100px;
}

@keyframes loginEntrance {
    0% {
        opacity: 0;
        transform: translateY(50px) scale(0.9);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-container::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(255, 215, 0, 0.1), transparent);
    transform: scale(0);
    transition: transform 0.6s ease;
    z-index: -1;
}

.login-container:hover::before {
    transform: scale(1);
}

/* ==========================================================================
   Login Logo
   ========================================================================== */
.login-logo {
    text-align: center;
    margin-bottom: 2.5rem;
    position: relative;
}

.logo-main {
    font-size: 3rem;
    font-weight: bold;
    color: #ffd700;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
    margin-bottom: 0.625rem;
    display: block;
    background: linear-gradient(45deg, #ffd700, #ff6b35, #ffd700);
    background-size: 200% 200%;
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    animation: goldShimmer 3s ease infinite;
}

@keyframes goldShimmer {
    0%,
    100% {
        background-position: 0% 50%;
    }
    50% {
        background-position: 100% 50%;
    }
}

.logo-subtitle {
    font-size: 1rem;
    opacity: 0.8;
    color: #f0e6d2;
}

/* ==========================================================================
   Login Form
   ========================================================================== */
.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.875rem;
}

.form-group {
    position: relative;
}

.form-label {
    display: block;
    margin-bottom: 0.75rem;
    font-size: 1rem;
    color: #ffd700;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* ==========================================================================
   Phone Number Input
   ========================================================================== */
.phone-container {
    position: relative;
}

.phone-prefix {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(45deg, #ffd700, #ff6b35);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    font-weight: bold;
    font-size: 1.125rem;
    z-index: 2;
}

.phone-input {
    width: 100%;
    padding: 1.125rem 1.25rem 1.125rem 3.75rem;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    color: #f0e6d2;
    font-size: 1.125rem;
    font-family: "Georgia", serif;
    transition: all 0.3s ease;
    letter-spacing: 2px;
}

.phone-input:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3);
    background: rgba(0, 0, 0, 0.6);
}

.phone-input::placeholder {
    color: rgba(240, 230, 210, 0.5);
    letter-spacing: 1px;
}

/* ==========================================================================
   PIN Input
   ========================================================================== */
.pin-container {
    display: flex;
    gap: 0.875rem;
    justify-content: center;
}

.pin-box {
    width: 70px;
    height: 70px;
    background: rgba(0, 0, 0, 0.4);
    border: 2px solid rgba(255, 215, 0, 0.3);
    border-radius: 15px;
    text-align: center;
    font-size: 2rem;
    font-weight: bold;
    color: #ffd700;
    transition: all 0.3s ease;
    caret-color: transparent;
    font-family: "Georgia", serif;
    /* Hide the text like password field */
    -webkit-text-security: disc;
    text-security: disc;
}

/* For browsers that don't support text-security */
@supports not (-webkit-text-security: disc) {
    .pin-box {
        letter-spacing: 0.5em;
    }
}

.pin-box:focus {
    outline: none;
    border-color: #ffd700;
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.4);
    background: rgba(0, 0, 0, 0.6);
    transform: scale(1.1);
}

.pin-box.filled {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
    animation: pinFill 0.3s ease;
}

@keyframes pinFill {
    0% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.15);
    }
    100% {
        transform: scale(1);
    }
}

/* ==========================================================================
   Validation States
   ========================================================================== */
.form-group.error .phone-input {
    border-color: #ef4444;
}

.form-group.valid .phone-input {
    border-color: #ffd700;
    background: rgba(255, 215, 0, 0.1);
}

.pin-box.valid {
    background: rgba(255, 215, 0, 0.1);
    border-color: #ffd700;
}

/* ==========================================================================
   Validation Message
   ========================================================================== */
.validation-message {
    position: absolute;
    bottom: -20px;
    left: 0;
    font-size: 0.75rem;
    color: #ef4444;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.validation-message.show {
    opacity: 1;
}

/* ==========================================================================
   Login Button
   ========================================================================== */
.login-button {
    padding: 1.25rem 2.5rem;
    background: linear-gradient(45deg, #ffd700, #ff6b35);
    color: #0a0a0a;
    border: none;
    border-radius: 50px;
    font-size: 1.125rem;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
    position: relative;
    overflow: hidden;
    margin-top: 1.25rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-family: "Georgia", serif;
}

.login-button::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition:
        width 0.6s ease,
        height 0.6s ease;
    z-index: 1;
}

.login-button span {
    position: relative;
    z-index: 2;
}

.login-button:hover:not(:disabled) {
    transform: scale(1.05);
    box-shadow: 0 15px 40px rgba(255, 215, 0, 0.4);
}

.login-button:hover:not(:disabled)::before {
    width: 400px;
    height: 400px;
}

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

.login-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.login-button:disabled::before {
    display: none;
}

/* ==========================================================================
   Button States
   ========================================================================== */
.login-button.success {
    background: linear-gradient(45deg, #4ade80, #22c55e);
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.7);
    }
    70% {
        transform: scale(1.05);
        box-shadow: 0 0 0 20px rgba(74, 222, 128, 0);
    }
    100% {
        transform: scale(1);
        box-shadow: 0 0 0 0 rgba(74, 222, 128, 0);
    }
}

.login-button.loading {
    pointer-events: none;
}

.login-button.loading span {
    opacity: 0;
}

.login-button.loading::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid #0a0a0a;
    border-top: 2px solid transparent;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    animation: spin 1s linear infinite;
    z-index: 3;
}

@keyframes spin {
    0% {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    100% {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* ==========================================================================
   Forgot PIN Link
   ========================================================================== */
.forgot-pin {
    text-align: center;
    margin-top: 0.5rem;
}

.forgot-pin a {
    color: rgba(255, 215, 0, 0.8);
    text-decoration: none;
    font-size: 0.875rem;
    transition: all 0.3s ease;
}

.forgot-pin a:hover {
    color: #ffd700;
    text-decoration: underline;
}

/* ==========================================================================
   Error Message
   ========================================================================== */
.error-message {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid #ef4444;
    border-radius: 10px;
    padding: 0.875rem;
    margin-top: 1.25rem;
    color: #fca5a5;
    text-align: center;
    font-size: 0.875rem;
    opacity: 0;
    transform: translateY(-10px);
    transition: all 0.3s ease;
}

.error-message.show {
    opacity: 1;
    transform: translateY(0);
}

/* ==========================================================================
   Decorative Elements
   ========================================================================== */
.baybayin-decoration {
    position: absolute;
    font-size: 80px;
    opacity: 0.1;
    color: #ffd700;
    animation: drift 30s infinite ease-in-out;
}

.decoration-1 {
    top: -20px;
    right: -20px;
}

.decoration-2 {
    bottom: -20px;
    left: -20px;
    animation-delay: -15s;
}

@keyframes drift {
    0%,
    100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(20px, -10px) rotate(120deg);
    }
    66% {
        transform: translate(-10px, 10px) rotate(240deg);
    }
}

/* ==========================================================================
   Wave Animation (shared with other pages)
   ========================================================================== */
.waves-container {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 150px;
    overflow: hidden;
    z-index: -1;
}

.boats-container {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 10;
}

.boat {
    position: absolute;
    width: 80px;
    height: 60px;
    opacity: 0.9;
}

.boat:nth-child(1) {
    animation: sailBoat1 25s infinite linear;
    bottom: 70px;
}

.boat:nth-child(2) {
    animation: sailBoat2 30s infinite linear;
    bottom: 60px;
    transform: scale(0.7);
    animation-delay: -10s;
}

.boat:nth-child(3) {
    animation: sailBoat3 35s infinite linear;
    bottom: 65px;
    transform: scale(0.9);
    animation-delay: -20s;
}

@keyframes sailBoat1 {
    0% {
        left: -100px;
        transform: translateY(0px);
    }
    25% {
        transform: translateY(-8px);
    }
    50% {
        transform: translateY(4px);
    }
    75% {
        transform: translateY(-4px);
    }
    100% {
        left: calc(100% + 100px);
        transform: translateY(0px);
    }
}

@keyframes sailBoat2 {
    0% {
        left: -100px;
        transform: translateY(0px) scale(0.7);
    }
    30% {
        transform: translateY(-6px) scale(0.7);
    }
    60% {
        transform: translateY(3px) scale(0.7);
    }
    80% {
        transform: translateY(-3px) scale(0.7);
    }
    100% {
        left: calc(100% + 100px);
        transform: translateY(0px) scale(0.7);
    }
}

@keyframes sailBoat3 {
    0% {
        left: -100px;
        transform: translateY(0px) scale(0.9);
    }
    20% {
        transform: translateY(-10px) scale(0.9);
    }
    40% {
        transform: translateY(5px) scale(0.9);
    }
    70% {
        transform: translateY(-5px) scale(0.9);
    }
    100% {
        left: calc(100% + 100px);
        transform: translateY(0px) scale(0.9);
    }
}

.boat svg {
    width: 100%;
    height: 100%;
    filter: drop-shadow(2px 2px 8px rgba(0, 0, 0, 0.4));
}

.waves {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 120px;
    overflow: hidden;
}

.wave {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.wave::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 200%;
    height: 80px;
    background: linear-gradient(
        to right,
        rgba(255, 215, 0, 0.4) 0%,
        rgba(255, 107, 53, 0.3) 25%,
        rgba(255, 215, 0, 0.4) 50%,
        rgba(255, 107, 53, 0.3) 75%,
        rgba(255, 215, 0, 0.4) 100%
    );
    border-radius: 50% 50% 0 0;
    animation: wave1 10s linear infinite;
}

.wave::after {
    content: "";
    position: absolute;
    bottom: 10px;
    left: 0;
    width: 200%;
    height: 60px;
    background: linear-gradient(
        to right,
        rgba(255, 107, 53, 0.3) 0%,
        rgba(255, 215, 0, 0.2) 25%,
        rgba(255, 107, 53, 0.3) 50%,
        rgba(255, 215, 0, 0.2) 75%,
        rgba(255, 107, 53, 0.3) 100%
    );
    border-radius: 50% 50% 0 0;
    animation: wave2 15s linear infinite;
}

@keyframes wave1 {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

@keyframes wave2 {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-50%);
    }
}

/* ==========================================================================
   Responsive Design
   ========================================================================== */
@media (max-width: 968px) {
    nav {
        background: rgba(0, 0, 0, 0.7);
        padding: 1.25rem 1.875rem;
    }

    .login-container {
        padding: 2.5rem 1.875rem;
        margin: 1.25rem;
        margin-top: 120px;
    }
}

@media (max-width: 480px) {
    nav {
        padding: 0.875rem 1.25rem;
    }

    .logo {
        font-size: 1.5rem;
    }

    .login-container {
        padding: 2.5rem 1.875rem;
        margin: 1.25rem;
        margin-top: 100px;
    }

    .logo-main {
        font-size: 2.25rem;
    }

    .pin-box {
        width: 60px;
        height: 60px;
        font-size: 1.75rem;
    }

    .pin-container {
        gap: 0.625rem;
    }
}
