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

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

:root {
    --primary: #2d7d46;
    --primary-light: #4a9e64;
    --primary-dark: #1a5a32;
    --secondary: #5ba3d4;
    --secondary-light: #8ac4e8;
    --accent: #e8f5ed;
    --white: #ffffff;
    --soft-white: #f8fbf9;
    --text: #1a2a2e;
    --text-light: #5a7a7a;
    --danger: #c0392b;
    --success: #237a3b;
    --shadow: 0 10px 40px rgba(45, 125, 70, 0.10);
    --shadow-hover: 0 20px 60px rgba(45, 125, 70, 0.18);
    --radius: 20px;
    --transition: all 0.3s ease;
}

body {
    font-family: 'Inter', 'Segoe UI', sans-serif;
    min-height: 100vh;
    color: var(--text);
    background:
        radial-gradient(circle at top right, rgba(91, 163, 212, 0.14), transparent 35%),
        radial-gradient(circle at bottom left, rgba(45, 125, 70, 0.12), transparent 35%),
        linear-gradient(180deg, var(--white), var(--accent));
}

.auth-header {
    width: 100%;
    background: rgba(255, 255, 255, 0.94);
    box-shadow: 0 4px 30px rgba(45, 125, 70, 0.08);
    border-bottom: 2px solid rgba(45, 125, 70, 0.08);
    backdrop-filter: blur(12px);
}

.header-container {
    max-width: 1180px;
    margin: 0 auto;
    padding: 15px 28px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.logo {
    text-decoration: none;
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.logo .dades { color: var(--primary); }
.logo .academy { color: var(--secondary); }

.back-home {
    text-decoration: none;
    color: var(--primary);
    background: var(--accent);
    border: 1px solid rgba(45, 125, 70, 0.12);
    padding: 9px 18px;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.85rem;
    transition: var(--transition);
}

.back-home:hover {
    color: var(--white);
    background: var(--primary);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(45, 125, 70, 0.22);
}

.auth-main {
    min-height: calc(100vh - 78px);
    padding: 50px 20px;
    display: grid;
    place-items: center;
}

.auth-layout {
    width: min(100%, 1000px);
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 28px;
    overflow: hidden;
    background: var(--white);
    box-shadow: var(--shadow-hover);
    border: 1px solid rgba(45, 125, 70, 0.08);
}

.auth-info {
    position: relative;
    overflow: hidden;
    padding: 55px 45px;
    color: var(--white);
    background: linear-gradient(145deg, var(--primary-dark), var(--primary), var(--secondary));
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-info::before,
.auth-info::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.08);
}

.auth-info::before {
    width: 260px;
    height: 260px;
    top: -100px;
    right: -100px;
}

.auth-info::after {
    width: 180px;
    height: 180px;
    bottom: -70px;
    left: -70px;
}

.auth-info > * {
    position: relative;
    z-index: 1;
}

.auth-badge {
    display: inline-flex;
    align-self: flex-start;
    background: rgba(255,255,255,0.16);
    border: 1px solid rgba(255,255,255,0.22);
    padding: 7px 16px;
    border-radius: 50px;
    font-size: .78rem;
    font-weight: 700;
    margin-bottom: 22px;
}

.auth-info h1 {
    font-size: 2.35rem;
    line-height: 1.15;
    margin-bottom: 16px;
}

.auth-info p {
    color: rgba(255,255,255,0.88);
    line-height: 1.8;
    font-size: .98rem;
}

.feature-list {
    list-style: none;
    margin-top: 26px;
    display: grid;
    gap: 12px;
}

.feature-list li {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255,255,255,0.94);
    font-size: .9rem;
}

.auth-card {
    padding: 48px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-card h2 {
    font-size: 2rem;
    margin-bottom: 8px;
    color: var(--text);
}

.auth-card .intro {
    color: var(--text-light);
    margin-bottom: 28px;
    font-size: .92rem;
}

.alert {
    padding: 12px 14px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: .88rem;
    line-height: 1.5;
}

.alert-error {
    color: #8f2418;
    background: #fff0ee;
    border: 1px solid #f3c7c1;
}

.alert-success {
    color: var(--success);
    background: #edf9f0;
    border: 1px solid #bfe2c7;
}

.form-group {
    margin-bottom: 17px;
}

.form-group label {
    display: block;
    font-size: .85rem;
    font-weight: 700;
    margin-bottom: 7px;
    color: var(--text);
}

.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 15px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    padding: 13px 46px 13px 44px;
    border-radius: 13px;
    border: 1px solid #dce8df;
    background: var(--soft-white);
    color: var(--text);
    outline: none;
    font: inherit;
    transition: var(--transition);
}

.input-wrap input:focus {
    background: var(--white);
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(45,125,70,.10);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    cursor: pointer;
    font-size: 1rem;
    padding: 5px;
}

.auth-button {
    width: 100%;
    margin-top: 7px;
    border: 0;
    border-radius: 13px;
    padding: 14px 20px;
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 10px 24px rgba(45,125,70,.2);
}

.auth-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(45,125,70,.28);
}

.auth-switch {
    text-align: center;
    margin-top: 22px;
    color: var(--text-light);
    font-size: .9rem;
}

.auth-switch a {
    color: var(--primary);
    font-weight: 800;
    text-decoration: none;
}

.auth-switch a:hover {
    text-decoration: underline;
}

.small-note {
    margin-top: 12px;
    color: var(--text-light);
    font-size: .76rem;
    text-align: center;
}

@media (max-width: 800px) {
    .auth-layout {
        grid-template-columns: 1fr;
        max-width: 560px;
    }

    .auth-info {
        padding: 38px 30px;
    }

    .auth-info h1 {
        font-size: 1.85rem;
    }

    .feature-list {
        display: none;
    }
}

@media (max-width: 520px) {
    .header-container {
        padding: 13px 16px;
    }

    .logo {
        font-size: 1.25rem;
    }

    .back-home {
        padding: 8px 12px;
        font-size: .72rem;
    }

    .auth-main {
        padding: 25px 12px;
    }

    .auth-card {
        padding: 34px 22px;
    }

    .auth-info {
        padding: 30px 22px;
    }

    .auth-card h2 {
        font-size: 1.65rem;
    }
}
