/* ===== CSS VARIABLES ===== */
:root {
    --primary-green: #2e7b52;        
    --secondary-green: #4f9d69;    
    --highlight-yellow: #fff876;     
    --highlight-yellow-dark: #f9c74f;
    
    --bg-light: #e4e6e3;             
    --text-dark: #191919;
    --text-light: #404040;
    --text-price: #f11764;             
    --text-highlight: var(--primary-green);
    
    --card-bg: #98c58c;              
    --footer-bg: #469e6f;
    --border-color: #d2d6d2;
    
    --input-bg: #ffffff;
    --input-border: #c5cac5;
    --input-focus: var(--primary-green);
    
    --link-color: #cc9820;
    --link-hover: #da841b;
    
    --btn-primary-bg: var(--primary-green);
    --btn-primary-text: #fff;
    --btn-primary-hover: #5aa461;
    
    --btn-secondary-bg: var(--highlight-yellow);
    --btn-secondary-text: #2e2e2e;
    --btn-secondary-hover: var(--highlight-yellow-dark);
    
    --success: #90be6d;  
    --warning: #f9c74f;  
    --error: #f28482;
}

/* ===== DARK THEME ===== */
[data-theme="dark"] {
    --primary-green: #2e7b52;       
    --secondary-green: #4f9d69;     
    --highlight-yellow: #ffd670;     
    --highlight-yellow-dark: #f9c74f;
    
    --bg-light: #1c1c1c;          
    --text-dark: #ededed;
    --text-light: #c0c0c0;
    --text-highlight: var(--highlight-yellow);
    --card-bg: #262626;
    --footer-bg: rgb(59, 134, 82);
    --border-color: #3a3a3a;
    
    --input-bg: #2a2a2a;
    --input-border: #3a3a3a;
    --input-focus: var(--highlight-yellow);
    
    --link-color: #ffd670;
    --link-hover: #f9c74f;
    
    --btn-primary-bg: var(--primary-green);
    --btn-primary-text: #fff;
    --btn-primary-hover: #336a42;
    
    --btn-secondary-bg: var(--highlight-yellow);
    --btn-secondary-text: #1c1c1c;
    --btn-secondary-hover: var(--highlight-yellow-dark);
    
    --success: #4f9d69;   
    --warning: #ffd670;
    --error: #f28b82;
}

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

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Poppins', sans-serif;
    background-color: var(--bg-light);
    color: var(--text-dark);
    transition: background-color 0.3s ease, color 0.3s ease;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    position: relative;
    overflow: hidden;
}

/* Background decoration */
body::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(46, 123, 82, 0.1) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 20s ease-in-out infinite;
}

body::after {
    content: '';
    position: absolute;
    bottom: -30%;
    left: -10%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(255, 248, 118, 0.08) 0%, transparent 70%);
    border-radius: 50%;
    animation: float 15s ease-in-out infinite reverse;
}

/* ===== MAIN CONTAINER ===== */
main {
    background: linear-gradient(145deg, var(--card-bg) 0%, rgba(152, 197, 140, 0.95) 140%);
    padding: 2.5rem 2rem;
    border-radius: 20px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    width: 100%;
    max-width: 450px;
    text-align: center;
    position: relative;
    z-index: 1;
    animation: slideIn 0.5s ease;
    overflow: hidden;
}

main::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
   
    pointer-events: none;
}

main > * {
    position: relative;
    z-index: 1;
}

/* ===== HEADER ===== */
main h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-highlight);
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

main h1::before {
    content: '\f007';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--primary-green);
}

/* ===== FORM ===== */
form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

/* ===== FORM GROUPS ===== */
form > div {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    text-align: left;
}

label {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

label::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    color: var(--primary-green);
    font-size: 0.9rem;
}

form > div:first-of-type label::before {
    content: '\f0e0';
}

form > div:nth-of-type(2) label::before {
    content: '\f023';
}

/* ===== INPUTS ===== */
input[type="email"],
input[type="password"] {
    width: 100%;
    padding: 1rem 1.2rem;
    font-size: 1rem;
    font-family: 'Nunito', sans-serif;
    background-color: var(--input-bg);
    color: var(--text-dark);
    border: 2px solid var(--input-border);
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
}

input[type="email"]::placeholder,
input[type="password"]::placeholder {
    color: var(--text-light);
    opacity: 0.7;
}

input[type="email"]:focus,
input[type="password"]:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 4px rgba(46, 123, 82, 0.1);
    transform: translateY(-2px);
}

[data-theme="dark"] input[type="email"]:focus,
[data-theme="dark"] input[type="password"]:focus {
    box-shadow: 0 0 0 4px rgba(255, 214, 112, 0.1);
}

/* Password visibility toggle (se implementado) */
.password-wrapper {
    position: relative;
}

.toggle-password {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    color: var(--text-light);
    transition: color 0.3s ease;
}

.toggle-password:hover {
    color: var(--primary-green);
}

/* ===== SUBMIT BUTTON ===== */
button[type="submit"] {
    width: 100%;
    padding: 1.1rem 1.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Nunito', sans-serif;
    background: linear-gradient(135deg, var(--btn-primary-bg) 0%, var(--btn-primary-hover) 100%);
    color: var(--btn-primary-text);
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    box-shadow: 0 4px 12px rgba(46, 123, 82, 0.2);
}

button[type="submit"]::after {
    content: '\f2f6';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    transition: transform 0.3s ease;
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, var(--btn-primary-hover) 0%, var(--primary-green) 100%);
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(46, 123, 82, 0.3);
}

button[type="submit"]:hover::after {
    transform: translateX(4px);
}

button[type="submit"]:active {
    transform: translateY(-1px);
}

/* ===== LINKS ===== */
.links {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.links a {
    color: var(--link-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    position: relative;
}

.links a::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--link-hover);
    transition: width 0.3s ease;
}

.links a:hover {
    color: var(--link-hover);
    transform: translateX(2px);
}

.links a:hover::after {
    width: 100%;
}

.links a:first-child::before {
    content: '\f234';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.85rem;
}

.links a:last-child::before {
    content: '\f084';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 0.85rem;
}

/* ===== ERROR/SUCCESS MESSAGES ===== */
.message {
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.6rem;
    animation: slideIn 0.3s ease;
}

.message.error {
    background: linear-gradient(135deg, var(--error) 0%, #ff6b6b 100%);
    color: #fff;
}

.message.success {
    background: linear-gradient(135deg, var(--success) 0%, #6fcf97 100%);
    color: #fff;
}

.message::before {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 1.2rem;
}

.message.error::before {
    content: '\f06a';
}

.message.success::before {
    content: '\f058';
}

/* ===== LOGO (opcional) ===== */
.logo {
    margin-bottom: 2rem;
    display: flex;
    justify-content: center;
}

.logo img {
    max-width: 150px;
    height: auto;
    animation: fadeIn 0.6s ease;
}

/* ===== ANIMATIONS ===== */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes float {
    0%, 100% {
        transform: translateY(0) rotate(0deg);
    }
    50% {
        transform: translateY(-20px) rotate(5deg);
    }
}

/* ===== RESPONSIVE - MOBILE ===== */
@media (max-width: 480px) {
    body {
        padding: 0.5rem;
    }

    main {
        padding: 2rem 1.5rem;
        max-width: 100%;
    }

    main h1 {
        font-size: 1.6rem;
        flex-direction: column;
        gap: 0.5rem;
    }

    input[type="email"],
    input[type="password"] {
        font-size: 0.95rem;
        padding: 0.9rem 1rem;
    }

    button[type="submit"] {
        font-size: 1rem;
        padding: 1rem 1.2rem;
    }

    .links {
        flex-direction: column;
        gap: 0.8rem;
        text-align: center;
    }

    .links a {
        justify-content: center;
    }
}

/* ===== RESPONSIVE - TABLET (768px+) ===== */
@media (min-width: 768px) {
    main {
        padding: 3rem 2.5rem;
        max-width: 500px;
    }

    main h1 {
        font-size: 2.2rem;
    }

    input[type="email"],
    input[type="password"] {
        padding: 1.1rem 1.3rem;
        font-size: 1.05rem;
    }

    button[type="submit"] {
        padding: 1.2rem 1.5rem;
        font-size: 1.1rem;
    }

    .links {
        font-size: 0.95rem;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    body::before,
    body::after {
        animation: none;
    }
}

*:focus-visible {
    outline: 3px solid var(--primary-green);
    outline-offset: 2px;
}

[data-theme="dark"] *:focus-visible {
    outline-color: var(--highlight-yellow);
}

/* ===== LOADING STATE ===== */
button[type="submit"].loading {
    pointer-events: none;
    opacity: 0.7;
}

button[type="submit"].loading::after {
    content: '\f110';
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}