@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap');

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Poppins', sans-serif;
    min-height: 100vh;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    padding: 20px;
    position: relative;
    overflow-x: hidden;
}

.auth-layout {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
    padding: 20px 15px;
    position: relative;
    z-index: 1;
}

/* Animated Background */
.animated-background {
    position: fixed;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    z-index: 0;
    overflow: hidden;
}

.floating-shape {
    position: absolute;
    border-radius: 50%;
    opacity: 0.1;
    animation: float 20s infinite ease-in-out;
}

.shape1 {
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #ff6b6b, #feca57);
    top: 10%;
    left: 10%;
    animation-delay: 0s;
}

.shape2 {
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #48dbfb, #0abde3);
    top: 60%;
    right: 10%;
    animation-delay: 5s;
}

.shape3 {
    width: 250px;
    height: 250px;
    background: linear-gradient(45deg, #5f27cd, #341f97);
    bottom: 10%;
    left: 50%;
    animation-delay: 10s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    25% {
        transform: translate(50px, -50px) rotate(90deg);
    }
    50% {
        transform: translate(-30px, -80px) rotate(180deg);
    }
    75% {
        transform: translate(-60px, -30px) rotate(270deg);
    }
}

/* Login Container with Glassmorphism */
.login-container {
    position: relative;
    z-index: 1;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(20px);
    border-radius: 30px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3),
                0 0 0 1px rgba(255, 255, 255, 0.2) inset;
    padding: 50px 40px;
    width: 100%;
    max-width: 480px;
    border: 1px solid rgba(255, 255, 255, 0.18);
}

/* Logo Section */
.logo-section {
    text-align: center;
    margin-bottom: 40px;
}

.logo {
    width: 120px;
    height: 120px;
    object-fit: contain;
    margin-bottom: 20px;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(102, 126, 234, 0.3);
    transition: transform 0.3s ease;
}

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

.brand-title {
    font-size: 2.2rem;
    font-weight: 700;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 10px;
}

.brand-subtitle {
    color: #6c757d;
    font-size: 0.95rem;
    font-weight: 400;
}

/* Form Styling */
.login-form {
    width: 100%;
}

.full-width {
    width: 100%;
}

.form-alert {
    padding: 14px 16px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 20px;
    border: 1px solid transparent;
    display: flex;
    align-items: center;
    gap: 10px;
}

.form-alert.info {
    background: rgba(102, 126, 234, 0.12);
    border-color: rgba(102, 126, 234, 0.3);
    color: #3743a1;
}

.form-alert.error {
    background: rgba(245, 101, 101, 0.12);
    border-color: rgba(245, 101, 101, 0.35);
    color: #a12626;
}

.form-alert.success {
    background: rgba(72, 187, 120, 0.12);
    border-color: rgba(72, 187, 120, 0.35);
    color: #21623b;
}

.hidden {
    display: none !important;
}

.input-group {
    position: relative;
    margin-bottom: 25px;
}

.input-group i {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    color: #667eea;
    font-size: 1.1rem;
    z-index: 1;
}

.input-group input {
    width: 100%;
    padding: 15px 45px;
    font-size: 15px;
    border-radius: 15px;
    border: 2px solid #e9ecef;
    background-color: #f8f9fa;
    transition: all 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.input-group input:focus {
    outline: none;
    border-color: #667eea;
    background-color: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.input-group label {
    position: absolute;
    left: 45px;
    top: 50%;
    transform: translateY(-50%);
    color: #6c757d;
    font-size: 15px;
    pointer-events: none;
    transition: all 0.3s ease;
    background: transparent;
}

.input-group input:focus + label,
.input-group input:not(:placeholder-shown) + label {
    top: -10px;
    font-size: 12px;
    color: #667eea;
    background: #fff;
    padding: 0 8px;
    left: 38px;
}

.input-group .toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: transparent;
    border: none;
    color: #667eea;
    width: 34px;
    height: 34px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, color 0.3s ease;
}

.input-group .toggle-password:hover,
.input-group .toggle-password:focus-visible {
    background: rgba(102, 126, 234, 0.12);
    color: #764ba2;
    outline: none;
}

/* Primary Button */
.btn-primary {
    width: 100%;
    padding: 16px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 15px;
    border: none;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    cursor: pointer;
    transition: all 0.4s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 10px;
    box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(102, 126, 234, 0.5);
}

.btn-primary:active {
    transform: translateY(-1px);
}

.btn-primary i {
    transition: transform 0.3s ease;
}

.btn-primary:hover i {
    transform: translateX(5px);
}

/* Form Links */
.form-links {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    font-size: 14px;
}

.link-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #667eea;
    font-weight: 500;
    cursor: pointer;
    padding: 4px 0;
    transition: color 0.3s ease, transform 0.3s ease;
    font-family: 'Poppins', sans-serif;
}

.link-btn:hover,
.link-btn:focus-visible {
    color: #764ba2;
    transform: translateX(3px);
    outline: none;
}

/* Divider */
.divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 30px 0 25px;
    color: #6c757d;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid #dee2e6;
}

.divider span {
    padding: 0 15px;
}

.stack-form {
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field label {
    font-weight: 600;
    font-size: 0.95rem;
    color: #283046;
}

.form-field input {
    padding: 14px 16px;
    border-radius: 14px;
    border: 2px solid #e9ecef;
    background: #f8f9fa;
    font-family: 'Poppins', sans-serif;
    transition: all 0.3s ease;
}

.form-field input:focus {
    outline: none;
    border-color: #667eea;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(102, 126, 234, 0.1);
}

.form-field.checkbox {
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.form-field.checkbox input {
    width: auto;
    margin-top: 5px;
    accent-color: #667eea;
    box-shadow: none;
}

.form-field.checkbox label {
    font-weight: 500;
    color: #465064;
}

.option-group {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 12px;
    border: 1px solid rgba(102, 126, 234, 0.2);
    border-radius: 16px;
    padding: 14px 16px;
}

.option-group legend {
    font-size: 0.9rem;
    font-weight: 600;
    color: #283046;
    padding: 0 6px;
}

.option-group label {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
}

.option-group input[type="radio"] {
    accent-color: #667eea;
}

.provider-preview {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 12px;
    padding: 18px;
    border-radius: 16px;
    background: rgba(102, 126, 234, 0.08);
    border: 1px solid rgba(102, 126, 234, 0.18);
}

.provider-image {
    flex-shrink: 0;
    width: 72px;
    height: 72px;
    aspect-ratio: 1 / 1;
    border-radius: 18px;
    overflow: hidden;
    display: grid;
    place-items: center;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 8px 20px rgba(102, 126, 234, 0.18);
}

.provider-image img {
    width: 48%;
    height: 48%;
    object-fit: contain;
}

.provider-copy h3 {
    font-size: 1.05rem;
    margin-bottom: 4px;
    color: #2d3748;
}

.provider-copy p {
    font-size: 0.9rem;
    color: #4a5568;
    line-height: 1.4;
}

.helper-text {
    font-size: 0.8rem;
    color: #6c757d;
    line-height: 1.5;
}

/* Social Login Buttons */
.social-login {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.social-btn {
    width: 55px;
    height: 55px;
    border-radius: 50%;
    border: 2px solid #e9ecef;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    transition: all 0.3s ease;
}

.social-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.social-btn:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.social-btn.google:hover {
    border-color: #ea4335;
}

.social-btn.github:hover {
    border-color: #333;
}

.social-btn.facebook:hover {
    border-color: #1877f2;
}

/* Footer */
footer {
    position: relative;
    z-index: 1;
    text-align: center;
    margin-top: 30px;
    color: white;
}

.footer-content {
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    padding: 20px;
    border-radius: 15px;
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.footer-content p {
    margin: 8px 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.copyright {
    font-size: 0.85rem;
    opacity: 0.8;
}

/* Modals */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 10;
}

.modal-backdrop.active {
    opacity: 1;
    pointer-events: all;
}

.modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
    z-index: 20;
    pointer-events: none;
}

.modal:not(.hidden) {
    pointer-events: all;
}

.modal-content {
    width: min(520px, 100%);
    background: rgba(255, 255, 255, 0.98);
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 25px 70px rgba(15, 23, 42, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.35);
    position: relative;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 1.4rem;
    color: #1f2a44;
}

.modal-subtitle {
    font-size: 0.9rem;
    color: #6c757d;
    margin-top: 4px;
}

.modal-close {
    background: rgba(102, 126, 234, 0.1);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #667eea;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease;
}

.modal-close:hover,
.modal-close:focus-visible {
    background: rgba(102, 126, 234, 0.2);
    transform: rotate(90deg);
    outline: none;
}

/* Micro animations */
[data-animate] {
    opacity: 1;
    transform: none;
}

html.animations-ready [data-animate="rise"] {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

html.animations-ready [data-animate="rise"].animated {
    opacity: 1;
    transform: translateY(0);
}

/* Responsive Design */
@media (max-width: 600px) {
    .login-container {
        padding: 40px 25px;
    }
    
    .brand-title {
        font-size: 1.8rem;
    }
    
    .logo {
        width: 90px;
        height: 90px;
    }

    .provider-preview {
        flex-direction: column;
        align-items: flex-start;
    }

    .provider-image {
        width: 100%;
        height: auto;
        border-radius: 14px;
    }

    .provider-image img {
        width: 28%;
        height: 28%;
    }
}

@media (max-width: 420px) {
    .modal-content {
        padding: 24px 20px;
    }

    .option-group {
        grid-template-columns: 1fr;
    }
}
