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

/* Todo el login: fondo blanco, letras verde */
body {
    background: #fff;
    color: #2e7d32;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    margin: 0;
    min-height: 100vh;
    padding: 0;
    overflow-x: hidden;
    position: relative;
}

.container {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 20px 40px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    box-sizing: border-box;
}

/* Card blanca central (login y registro) */
.form-container {
    position: relative;
    width: 100%;
    background: #fff;
    border-radius: 20px;
    padding: 26px 22px 28px;
    box-sizing: border-box;
}

/* Botón volver atrás en registro */
.btn-back-to-login {
    position: absolute;
    top: 16px;
    left: 16px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: #2e7d32;
    cursor: pointer;
    font-size: 14px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color 0.2s, background 0.2s;
}
.btn-back-to-login:hover {
    color: #1b5e20;
    background: rgba(46, 125, 50, 0.1);
}

/* Icono/logo al medio */
.form-container .logo-section {
    margin-bottom: 24px;
    text-align: center;
}
.form-container .logo-section .logo-icon-img {
    display: block;
    margin: 0 auto;
    height: 96px;
    width: auto;
    max-width: 420px;
    object-fit: contain;
}
.form-container .brand-name {
    font-size: 20px;
    font-weight: 800;
    color: #2e7d32;
    letter-spacing: 0.8px;
    text-transform: uppercase;
}

.form-container h2 {
    margin: 0 0 18px 0;
    font-size: 17px;
    font-weight: 700;
    color: #2e7d32;
    text-align: left;
    background: none;
    letter-spacing: 0;
}
.form-container h2::after {
    display: none;
}

/* Inputs: blanco, borde gris fino, border-radius 5px como en la imagen */
.input-group {
    position: relative;
    margin-bottom: 14px;
}
/* Icono dentro del cuadro de cada input (registro) */
.input-group.input-with-icon .input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #2e7d32;
    font-size: 12px;
    z-index: 1;
    pointer-events: none;
}
.input-group.input-with-icon input {
    padding-left: 38px;
}
.form-container input {
    background: #fff;
    border: 1px solid #c8e6c9;
    border-radius: 5px;
    color: #2e7d32;
    padding: 13px 44px 13px 14px;
    width: 100%;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-container input::placeholder {
    color: #66bb6a;
}
.form-container input:focus {
    border-color: #2e7d32;
    box-shadow: 0 0 0 2px rgba(46, 125, 50, 0.2);
    outline: none;
    background: #fff;
    transform: none;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #2e7d32;
    cursor: pointer;
    font-size: 12px;
    padding: 4px 6px;
}
.password-toggle:hover {
    color: #1b5e20;
}

/* Botón principal: Iniciar sessão */
.btn-submit.btn-primary {
    width: 100%;
    background: #2e7d32;
    color: #fff;
    padding: 13px 16px;
    border: none;
    border-radius: 5px;
    font-weight: 600;
    font-size: 15px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-top: 6px;
    margin-bottom: 12px;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.3);
    transition: background 0.2s, transform 0.2s;
}
.btn-submit.btn-primary:hover {
    background: #1b5e20;
    transform: translateY(-1px);
}
/* Botones secundarios: blanco, borde gris claro */
.btn-secondary {
    width: 100%;
    background: #fff;
    color: #1a1a1a;
    padding: 13px 16px;
    border: 1px solid #E0E0E0;
    border-radius: 5px;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 12px;
    text-decoration: none;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    transition: background 0.2s, border-color 0.2s;
}
.btn-secondary:hover {
    background: #f8f8f8;
    border-color: #d0d0d0;
}
/* Loader en botón */
.btn-submit .loader {
    display: none;
    border: 2px solid rgba(255,255,255,0.3);
    border-top: 2px solid #fff;
    border-radius: 50%;
    width: 18px;
    height: 18px;
    animation: spin 1s linear infinite;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}
.btn-submit.submitting .loader {
    display: block;
}
.btn-submit.submitting span {
    visibility: hidden;
}

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

/* Enlaces debajo de los botones */
.form-container > form > p {
    font-size: 12px;
    text-align: center;
    color: #666;
    margin: 8px 0 4px;
}
.form-container > form > p.key-link {
    margin-top: 4px;
}
/* Cuadro con Regístrate y ¿Aún no tienes KEY? separados por línea, cada uno con cuadro e icono */
.links-box {
    width: 100%;
    margin-top: 16px;
    padding: 12px;
    border: 1px solid #c8e6c9;
    border-radius: 8px;
    background: #fff;
    box-sizing: border-box;
}
.links-box-divider {
    height: 1px;
    background: #c8e6c9;
    margin: 10px 0;
}
.links-box-item {
    padding: 6px 0;
    font-size: 14px;
}
.links-box-item-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid #c8e6c9;
    border-radius: 6px;
    background: #f8fff8;
}
.links-box-item-box + .links-box-divider + .links-box-item-box {
    margin-top: 0;
}
.links-box-icon {
    color: #2e7d32;
    font-size: 12px;
    flex-shrink: 0;
}
.link-green,
.text-green {
    color: #2e7d32;
    font-weight: 600;
}
.form-container a.link-green {
    color: #2e7d32;
    text-decoration: none;
}
.form-container a.link-green:hover {
    text-decoration: underline;
}
.btn-link-green {
    background: none;
    border: none;
    color: #2e7d32;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    padding: 0;
    font-family: inherit;
}
.btn-link-green:hover {
    text-decoration: underline;
}

/* Notificaciones */
.notification-area .alert {
    border-radius: 10px;
    padding: 15px 20px;
    margin-bottom: 15px;
    font-family: 'Segoe UI', sans-serif;
    font-size: 15px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}
.notification-area .alert-success { background-color: #d4edda; color: #155724; }
.notification-area .alert-danger  { background-color: #f8d7da; color: #721c24; }
.notification-area .alert-info    { background-color: #d1ecf1; color: #0c5460; }
.notification-area .login-error-msg { color: #b91c1c !important; white-space: nowrap; display: block; font-size: 12px; padding: 6px 12px !important; }

/* Registro: mismos colores y estilo */
#register-form .btn-submit {
    background: #2e7d32;
    color: #fff;
    border: none;
    padding: 13px 16px;
    border-radius: 5px;
    font-weight: 600;
    width: 100%;
    margin-top: 6px;
    margin-bottom: 12px;
}
#register-form .btn-submit:hover {
    background: #1b5e20;
}
