/* 1. VARIABLES Y RESET */
:root {
    --primary-color: #4CAF50;
    --primary-hover: #45a049;
    --secondary-color: #2d3b55;
    --bg-gradient: linear-gradient(135deg, #f4f7f9, #e0ebf5);
    --white: #ffffff;
    --text-main: #333;
    --text-muted: #666;
    --border-color: #eaeff2;
    --shadow-soft: 0 15px 35px rgba(0, 0, 0, 0.08);
    --shadow-strong: 0 20px 40px rgba(0, 0, 0, 0.12);
}

body {
    background: var(--bg-gradient);
    font-family: 'Open Sans', sans-serif;
    color: var(--text-main);
    margin: 0;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 2. LOGO */
.auth-logo {
    text-align: center;
    margin: 40px 0 10px;
}

.logo-register {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 4px solid var(--white);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    object-fit: cover;
}

/* 3. CONTENEDOR UNIFICADO (Para Login y Registro) */
#register-form,
.login-form {
    max-width: 450px;
    width: 90%;
    margin: 20px auto 40px;
    padding: 40px;
    border-radius: 20px;
    background-color: var(--white);
    box-shadow: var(--shadow-soft);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    /* Eliminamos el borde del login anterior */
}

#register-form:hover,
.login-form:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-strong);
}

/* 4. TIPOGRAFÍA */
.form-header,
.login-form h2 {
    text-align: center;
    margin-bottom: 30px;
}

h1,
h2 {
    font-size: 1.8rem;
    color: var(--secondary-color);
    margin: 0 0 10px;
    font-weight: 700;
}

p.subtitle {
    color: var(--text-muted);
    font-size: 0.95rem;
    margin: 0;
}

/* 5. INPUTS Y FORM GROUPS */
.form-group {
    margin-bottom: 22px;
    position: relative;
}

label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--secondary-color);
    margin-bottom: 8px;
    display: block;
}

input[type="text"],
input[type="email"],
input[type="password"],
.login-form input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    font-size: 1rem;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
    background: #fdfdfd;
}

input:focus {
    border-color: var(--primary-color);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(76, 175, 80, 0.15);
}

/* 6. SELECTOR DE TIPO (RADIO BUTTONS) */
.user-type-selector {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
    margin: 25px 0;
}

.type-option label {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 20px 10px;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    cursor: pointer;
    background: var(--white);
    transition: all 0.3s;
}

.type-option input[type="radio"]:checked+label {
    border-color: var(--primary-color);
    background-color: #f1f9f1;
    color: var(--primary-color);
}

/* 7. BOTONES */
.submit-btn-reg,
.submit-btn-login,
.google-sign-in-btn {
    width: 100%;
    padding: 16px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
}

.submit-btn-reg,
.submit-btn-login {
    background-color: var(--primary-color);
    color: var(--white);
    box-shadow: 0 6px 15px rgba(76, 175, 80, 0.25);
    margin-top: 15px;
}

.submit-btn-reg:hover,
.submit-btn-login:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(76, 175, 80, 0.35);
}

.google-sign-in-btn {
    background-color: var(--white);
    color: #444;
    border: 1px solid #dadce0;
    margin-top: 15px;
    font-weight: 600;
}

.google-sign-in-btn:hover {
    background-color: #f8f9fa;
    border-color: #c6c8cc;
}

/* 8. LINKS Y PIE */
.login-link,
.register-link {
    text-align: center;
    margin-top: 25px;
    font-size: 0.95rem;
}

.login-link a,
.register-link a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 700;
}

.login-link a:hover {
    text-decoration: underline;
}

/* 9. PASSWORD WRAPPER */
.password-wrapper {
    position: relative;
}

#togglePassword {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
}

/* 10. MODALES */
.modal {
    background-color: rgba(45, 59, 85, 0.85);
    /* Un azul oscuro traslúcido */
    backdrop-filter: blur(5px);
}

.modal-content {
    background-color: var(--white);
    padding: 30px;
    border-radius: 20px;
    border: none;
    box-shadow: var(--shadow-strong);
}

/* RESPONSIVIDAD */
@media (max-width: 480px) {

    #register-form,
    .login-form {
        padding: 25px 20px;
    }

    h1 {
        font-size: 1.5rem;
    }
}

.role-section {
    display: none;
    background: #f9f9f9;
    padding: 15px;
    border-left: 4px solid #4CAF50;
    margin-top: 10px;
    border-radius: 10px;
}

.role-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
    gap: 8px;
}

.role-item input {
    display: none;
}

.role-item label {
    display: block;
    padding: 10px;
    cursor: pointer;
    border: 2px solid transparent;
    transition: 0.2s;
    background: #fff;
    text-align: center;
}

.role-item input:checked+label {
    border-color: #4CAF50;
    background: #e8f5e9;
}

.role-item label i {
    display: block;
    font-size: 20px;
    margin-bottom: 5px;
    color: #aaa;
}

.role-item label span {
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    color: #777;
}
