html,
body {
    height: 100%;
    overflow: hidden;
}

body {
    background: linear-gradient(180deg, #faf5ff 0%, #f3e8ff 100%);
    position: relative;
    overflow-x: hidden;
}

html::-webkit-scrollbar {
    display: none;
}

.wave {
    position: fixed;
    width: 200%;
    height: 100%;
    top: 0;
    left: -50%;
    z-index: 0;
    pointer-events: none;
}

.wave path {
    fill: rgba(167, 139, 250, 0.1);
    animation: wave-animation 10s ease-in-out infinite;
}

.wave:nth-child(2) path {
    fill: rgba(196, 181, 253, 0.08);
    animation: wave-animation 8s ease-in-out infinite reverse;
}

@keyframes wave-animation {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(-25%); }
}

.loader-container {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.loader {
    width: 48px;
    height: 48px;
    display: inline-block;
    position: relative;
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    box-sizing: border-box;
    animation: animloader 2s ease-in-out infinite;
    border-radius: 8px;
}

@keyframes animloader {
    0%, 100% {
        transform: rotate(0deg) scale(1);
    }
    25% {
        transform: rotate(180deg) scale(1.2);
    }
    50% {
        transform: rotate(180deg) scale(1);
    }
    75% {
        transform: rotate(360deg) scale(1.2);
    }
}

#loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, #f8f7ff 0%, #ffffff 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
}

#loading-screen p {
    margin-top: 20px;
    color: #7c3aed;
    font-weight: 500;
}

.content-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10;
}

.main-container {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    padding: 2rem 1rem;
    margin: 0 auto;
}

.login-container {
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(124, 58, 237, 0.1);
    border-radius: 2rem;
    position: relative;
    z-index: 10;
    width: 100%;
    max-width: 500px;
}

.login-container-with-logo {
    max-width: 1000px;
}

.input-field {
    transition: all 0.3s ease;
    border: 2px solid #e9e3f5;
    background: #ffffff;
}

.input-field:focus {
    border-color: #7c3aed;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.1);
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, #7c3aed 0%, #a78bfa 100%);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.3);
    transition: all 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.4);
}

.btn-primary:active {
    transform: translateY(0);
    box-shadow: 0 5px 15px rgba(124, 58, 237, 0.3);
}

.btn-secondary {
    background: #ffffff;
    border: 2px solid #e9e3f5;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    border-color: #7c3aed;
    background: #faf5ff;
    transform: translateY(-1px);
    box-shadow: 0 8px 20px rgba(124, 58, 237, 0.15);
}

.social-icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 60px;
    transition: all 0.3s ease;
    cursor: pointer;
    text-decoration: none;
}

.link-purple {
    color: #7c3aed;
    transition: all 0.2s ease;
    text-decoration: none;
    position: relative;
}

.link-purple:hover {
    color: #6d28d9;
}

.link-purple::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: linear-gradient(90deg, #7c3aed, #a78bfa);
    transition: width 0.3s ease;
}

.link-purple:hover::after {
    width: 100%;
}

.divider {
    position: relative;
    text-align: center;
    margin: 32px 0;
}

.divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, #e9e3f5, transparent);
}

.divider span {
    padding: 0 16px;
    position: relative;
    background: rgba(255, 255, 255, 0.95);
    color: #a78bfa;
    font-size: 14px;
    font-weight: 500;
}

.turnstile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(4px);
}

.turnstile-modal.show {
    display: flex;
}

.turnstile-modal-inner {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    padding: 12px 20px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-width: 300px;
    box-shadow: 0 4px 12px rgba(124, 58, 237, 0.1);
}

.turnstile-remember-label {
    color: #7c3aed;
    font-weight: 500;
    font-size: 14px;
}

.toggle-switch {
    position: relative;
    display: inline-block;
    width: 44px;
    height: 24px;
    margin: 0;
    cursor: pointer;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-track {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #e9e3f5;
    border-radius: 24px;
    transition: 0.3s;
}

.toggle-thumb {
    position: absolute;
    height: 18px;
    width: 18px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: 0.3s;
}

#remember-me-checkbox:checked + .toggle-track {
    background-color: #7c3aed;
}

#remember-me-checkbox:checked + .toggle-track + .toggle-thumb {
    transform: translateX(20px);
}

#remember-me-checkbox:focus + .toggle-track {
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

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

.fade-in {
    animation: fadeIn 0.6s ease forwards;
}

.alert-error {
    background: linear-gradient(135deg, #fef2f2 0%, #ffffff 100%);
    border: 1px solid #fca5a5;
    color: #dc2626;
}

.alert-success {
    background: linear-gradient(135deg, #f0fdf4 0%, #ffffff 100%);
    border: 1px solid #86efac;
    color: #16a34a;
}

.logo-container {
    border-radius: 2rem 0 0 2rem;
}

@media (max-width: 768px) {
    html,
    body {
        height: auto;
        min-height: 100vh;
        overflow-y: auto;
    }

    body {
        background: linear-gradient(180deg, #faf5ff 0%, #f3e8ff 100%);
    }

    .content-wrapper {
        position: relative;
        height: auto;
        min-height: 100vh;
        align-items: flex-start;
    }

    .main-container {
        padding: 1rem;
        min-height: 100vh;
        height: auto;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .login-container,
    .login-container-with-logo {
        max-width: 100%;
        width: 100%;
        margin: 0 auto;
        border-radius: 1.25rem;
    }

    .logo-container {
        border-radius: 2rem 2rem 0 0;
        display: none;
    }

    .w-full.p-8,
    .w-full.p-8.sm\:p-12 {
        padding: 1.25rem 1rem;
    }

    h1,
    h1.text-3xl,
    h1.mb-3.text-3xl {
        font-size: 0.910rem;
        margin-bottom: 0.5rem;
        line-height: 1.3;
    }

    p.text-sm,
    p.mb-8.text-sm {
        font-size: 0.585rem;
        margin-bottom: 1.25rem;
        line-height: 1.5;
        color: #6b7280;
    }

    label span,
    label.block span {
        font-size: 0.75rem;
        margin-bottom: 0.375rem;
        display: block;
    }

    label,
    label.block,
    label.block.mb-5 {
        margin-bottom: 0.875rem;
    }

    input,
    input[type="email"],
    input[type="password"],
    input[type="text"],
    .input-field {
        padding: 0.75rem 1rem;
        font-size: 0.875rem;
        border-radius: 0.875rem;
        min-height: 44px;
        height: auto;
        border-width: 2px;
    }

    input::placeholder,
    .input-field::placeholder {
        font-size: 0.813rem;
        color: #9ca3af;
    }

    input[name="password"] {
        padding-right: 3rem;
    }

    button[onclick="togglePassword()"],
    .absolute.inset-y-0.right-0 {
        padding-left: 0.5rem;
        padding-right: 1rem;
    }

    button[onclick="togglePassword()"] svg,
    .absolute.inset-y-0.right-0 svg {
        width: 1.125rem;
        height: 1.125rem;
    }

    button,
    button[type="submit"],
    .btn-primary,
    .btn-secondary,
    a.btn-secondary {
        padding: 0.75rem 1.25rem;
        font-size: 0.875rem;
        border-radius: 0.875rem;
        min-height: 44px;
        height: auto;
        font-weight: 600;
    }

    button svg,
    .btn-primary svg,
    .btn-secondary svg {
        width: 1rem;
        height: 1rem;
    }

    .social-icon-btn {
        width: 35px;
        height: 44px;
        border-radius: 0.75rem;
    }

    .social-icon-btn svg {
        width: 20px;
        height: 20px;
    }

    .divider {
        margin: 1.25rem 0;
    }

    .divider span {
        font-size: 0.813rem;
        padding: 0 0.875rem;
    }

    .alert-error,
    .alert-success {
        padding: 1rem;
        font-size: 0.9rem;
        margin-bottom: 1.5rem;
        border-radius: 1rem;
    }

    #loading-screen p {
        font-size: 0.938rem;
        margin-top: 1rem;
    }

    .loader {
        width: 40px;
        height: 40px;
    }

    .wave {
        opacity: 0.5;
    }
}

@media (max-width: 375px) {
    .main-container {
        padding: 1rem;
    }

    .w-full.p-8.sm\:p-12 {
        padding: 1rem;
    }

    h1.text-3xl {
        font-size: 1.125rem;
    }

    p.text-sm {
        font-size: 0.75rem;
    }

    .input-field {
        padding: 0.688rem 0.875rem;
        font-size: 0.875rem;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.688rem 1rem;
        font-size: 0.875rem;
        min-height: 42px;
    }

    .link-purple {
        font-size: 0.75rem;
    }

    .social-icon-btn {
        width: 40px;
        height: 40px;
    }

    .social-icon-btn svg {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 768px) and (orientation: landscape) {
    .main-container {
        padding: 1rem;
        align-items: flex-start;
    }

    .logo-container {
        height: 70px;
    }

    .w-full.p-8.sm\:p-12 {
        padding: 1rem;
    }

    h1.text-3xl {
        font-size: 1.375rem;
        margin-bottom: 0.25rem;
    }

    p.text-sm {
        font-size: 0.813rem;
        margin-bottom: 1rem;
    }

    label.block.mb-5 {
        margin-bottom: 0.875rem;
    }

    .divider {
        margin: 1rem 0;
    }

    .input-field {
        padding: 0.75rem 1rem;
        min-height: 48px;
    }

    .btn-primary,
    .btn-secondary {
        padding: 0.75rem 1.25rem;
        min-height: 48px;
    }

    .flex.flex-row.justify-between {
        margin-bottom: 1rem;
    }
}