/* Modern Login Page Styles */
* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

body {
    background: #76b852; /* fallback for old browsers */
    background: -webkit-linear-gradient(to bottom right, #8BC34A, #4CAF50, #2E7D32);
    background: -o-linear-gradient(to bottom right, #8BC34A, #4CAF50, #2E7D32);
    background: -moz-linear-gradient(to bottom right, #8BC34A, #4CAF50, #2E7D32);
    background: linear-gradient(to bottom right, #8BC34A, #4CAF50, #2E7D32);
    background-size: 100% 100%;
    background-repeat: no-repeat;
    background-attachment: fixed;
    font-family: "Roboto", sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: -webkit-fill-available; /* Soporte para iOS Safari */
    width: 100%;
    position: relative;
    overflow: hidden;
    touch-action: manipulation;
}

/* Background Logo */
body::before {
    content: '';
    position: fixed;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background-image: url('/b2b_conector/public/assets/images/logo.png');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
    opacity: 0.06;
    z-index: 0;
    pointer-events: none;
}

.login-page {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1;
    padding: 20px;
}

.form {
    position: relative;
    z-index: 1;
    background: #FFFFFF;
    max-width: 360px;
    margin: 0 auto;
    padding: 45px;
    text-align: center;
    box-shadow: 0 0 20px 0 rgba(0, 0, 0, 0.2), 0 5px 5px 0 rgba(0, 0, 0, 0.24);
    border-radius: 8px;
}

.form input {
    font-family: "Roboto", sans-serif;
    outline: 0;
    background: #f2f2f2;
    width: 100%;
    border: 0;
    margin: 0 0 15px;
    padding: 15px;
    box-sizing: border-box;
    font-size: 14px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    touch-action: manipulation;
}

.form input:focus {
    background: #e8e8e8;
    transform: scale(1.02);
}

.form button {
    font-family: "Roboto", sans-serif;
    text-transform: uppercase;
    outline: 0;
    background: #4CAF50;
    width: 100%;
    border: 0;
    padding: 15px;
    color: #FFFFFF;
    font-size: 14px;
    -webkit-transition: all 0.3s ease;
    transition: all 0.3s ease;
    cursor: pointer;
    border-radius: 4px;
    font-weight: 500;
}

.form button:hover,
.form button:active,
.form button:focus {
    background: #43A047;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.form .message {
    margin: 15px 0 0;
    color: #b3b3b3;
    font-size: 12px;
}

.form .message a {
    color: #4CAF50;
    text-decoration: none;
    font-weight: 500;
}

.form .message a:hover {
    text-decoration: underline;
}

.form .register-form {
    display: none;
}

/* Flash Messages */
.flash-messages-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 1000;
    max-width: 300px;
}

.flash-message {
    background: white;
    padding: 15px;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    border-left: 4px solid #4CAF50;
    animation: slideInRight 0.3s ease;
}

.flash-message--error {
    border-left-color: #f44336;
}

.flash-message--success {
    border-left-color: #4CAF50;
}

.flash-message__icon {
    margin-right: 10px;
    color: #4CAF50;
}

.flash-message--error .flash-message__icon {
    color: #f44336;
}

.flash-message__close {
    background: none;
    border: none;
    cursor: pointer;
    margin-left: auto;
    opacity: 0.7;
    font-size: 16px;
    padding: 4px;
}

.flash-message__close:hover {
    opacity: 1;
}

/* Logo in form */
.form-logo {
    text-align: center;
    margin: 0 auto 30px;
    display: block;
}

.form-logo img {
    width: 120px;
    height: auto;
    max-height: 80px;
    object-fit: contain;
    opacity: 1;
    display: block;
}

/* Form title */
.form-title {
    color: #333;
    font-size: 24px;
    font-weight: 300;
    margin: 0 0 30px 0;
}

/* Responsive Design */

/* Tablets y pantallas medianas */
@media (max-width: 768px) {
    .form {
        max-width: 340px;
        padding: 35px 25px;
    }
    
    .form-logo img {
        width: 100px;
        max-height: 70px;
    }
    
    .form-title {
        font-size: 22px;
        margin: 0 0 25px 0;
    }
    
    body::before {
        width: 75%;
        height: 75%;
        top: 25%;
        opacity: 0.05;
    }
}

/* Móviles */
@media (max-width: 480px) {
    .login-page {
        padding: 15px;
    }
    
    .form {
        max-width: none;
        width: 100%;
        padding: 30px 20px;
        margin: 0;
        box-shadow: 0 0 15px 0 rgba(0, 0, 0, 0.15), 0 3px 3px 0 rgba(0, 0, 0, 0.2);
    }
    
    .form-logo {
        margin: 0 auto 25px;
    }
    
    .form-logo img {
        width: 90px;
        max-height: 60px;
    }
    
    .form-title {
        font-size: 20px;
        margin: 0 0 20px 0;
    }
    
    .form input {
        padding: 12px;
        font-size: 16px; /* Evita zoom en iOS */
        margin: 0 0 12px;
    }
    
    .form button {
        padding: 12px;
        font-size: 16px;
        font-weight: 600;
    }
    
    .form .message {
        font-size: 14px;
        margin: 12px 0 0;
    }
    
    body::before {
        width: 90%;
        height: 90%;
        top: 20%;
        opacity: 0.04;
    }
    
    .flash-messages-container {
        position: fixed;
        top: 10px;
        left: 10px;
        right: 10px;
        max-width: none;
    }
}

/* Móviles pequeños */
@media (max-width: 360px) {
    .login-page {
        padding: 10px;
    }
    
    .form {
        padding: 25px 15px;
    }
    
    .form-logo img {
        width: 80px;
        max-height: 50px;
    }
    
    .form-title {
        font-size: 18px;
    }
    
    .form input {
        padding: 10px;
    }
    
    .form button {
        padding: 10px;
    }
}

/* Landscape en móviles */
@media (max-height: 600px) and (orientation: landscape) {
    .login-page {
        padding: 10px;
    }
    
    .form {
        padding: 20px;
        max-width: 320px;
    }
    
    .form-logo {
        margin: 0 auto 15px;
    }
    
    .form-logo img {
        width: 70px;
        max-height: 40px;
    }
    
    .form-title {
        font-size: 18px;
        margin: 0 0 15px 0;
    }
    
    .form input {
        margin: 0 0 10px;
        padding: 10px;
    }
    
    body::before {
        opacity: 0.03;
        width: 60%;
        height: 60%;
    }
}

/* Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100%);
    }
}

.flash-message.fade-out {
    animation: fadeOut 0.3s ease forwards;
}

/* Loading state */
.form.loading button {
    background: #43A047;
    cursor: not-allowed;
    position: relative;
}

.form.loading button::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 15px;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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