/* ============================================================
   ExamPrep — assets/css/main.css
   Brand: Management Academy (managementacademy.it)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@700&family=Open+Sans:wght@400;500;600;700&display=swap');

/* --- Reset & Base ------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --primary:    #022049;
    --primary-dk: #011633;
    --accent:     #2659F0;
    --accent-dk:  #1A45C9;
    --success:    #1D9E75;
    --danger:     #D85A30;
    --warning:    #BA7517;
    --gray-50:    #F6F8FF;
    --gray-100:   #E8EAF0;
    --gray-300:   #BFC3CE;
    --gray-600:   #5A5F6E;
    --gray-900:   #022049;
    --white:      #FFFFFF;
    --radius:     12px;
    --shadow:     0 2px 12px rgba(2,32,73,0.08);
    --font:       'Open Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-heading: 'Merriweather', Georgia, serif;
}

html { font-size: 16px; }
body {
    font-family: var(--font);
    background: var(--gray-50);
    color: var(--gray-900);
    line-height: 1.6;
    min-height: 100vh;
}
h1, h2, h3 { font-family: var(--font-heading); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* --- Pagina Login ------------------------------------------ */
.login-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 1rem;
    background: linear-gradient(135deg, var(--primary) 0%, #0a3270 100%);
}
.login-container { width: 100%; max-width: 420px; }
.login-box {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(2,32,73,0.2);
    padding: 2.5rem 2rem;
}
.login-header { text-align: center; margin-bottom: 2rem; }
.login-header img { max-width: 180px; margin-bottom: 1rem; }
.login-header h1 { font-size: 1.5rem; color: var(--primary); margin-bottom: 0.25rem; font-family: var(--font-heading); }
.login-header p  { color: var(--gray-600); font-size: 0.95rem; }
.login-footer    { text-align: center; margin-top: 1.5rem; font-size: 0.85rem; color: var(--gray-600); }

/* --- Alerts ----------------------------------------------- */
.alert {
    padding: 0.75rem 1rem;
    border-radius: var(--radius);
    margin-bottom: 1.25rem;
    font-size: 0.9rem;
}
.alert-info  { background: #E6F1FB; color: #0C447C; border-left: 3px solid var(--accent); }
.alert-error { background: #FCEBEB; color: #791F1F; border-left: 3px solid #E24B4A; }
.alert-ok    { background: #EAF3DE; color: #27500A; border-left: 3px solid #639922; }

/* --- Form -------------------------------------------------- */
.form-group        { margin-bottom: 1.25rem; }
.form-group label  { display: block; font-size: 0.9rem; font-weight: 600; margin-bottom: 0.4rem; color: var(--primary); }
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.65rem 0.9rem;
    border: 1.5px solid var(--gray-300);
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font);
    background: var(--white);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(38,89,240,0.12);
}

/* --- Buttons ---------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.65rem 1.25rem;
    border: none;
    border-radius: 8px;
    font-size: 1rem;
    font-family: var(--font);
    font-weight: 600;
    cursor: pointer;
    transition: background 0.15s, transform 0.1s, box-shadow 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-primary  {
    background: var(--accent);
    color: var(--white);
    box-shadow: 4px 4px 0px 0px var(--primary);
}
.btn-primary:hover {
    background: var(--accent-dk);
    box-shadow: 2px 2px 0px 0px var(--primary);
}
.btn-success  { background: var(--success); color: var(--white); }
.btn-danger   { background: var(--danger);  color: var(--white); }
.btn-outline  { background: transparent; border: 1.5px solid var(--gray-300); color: var(--gray-900); }
.btn-outline:hover { border-color: var(--accent); color: var(--accent); }
.btn-full     { width: 100%; justify-content: center; }
.btn-sm       { padding: 0.4rem 0.85rem; font-size: 0.875rem; box-shadow: 3px 3px 0px 0px var(--primary); }
.btn-sm:hover { box-shadow: 1px 1px 0px 0px var(--primary); }

/* --- Layout dashboard -------------------------------------- */
.app-layout { display: flex; min-height: 100vh; }

.sidebar {
    width: 250px;
    background: var(--primary);
    color: var(--white);
    padding: 1.5rem 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    flex-shrink: 0;
}
.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 0.75rem 1.5rem;
}
.sidebar-logo img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
}
.sidebar-logo span {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--white);
}
.sidebar a {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.6rem 0.75rem;
    border-radius: 8px;
    color: rgba(255,255,255,0.7);
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}
.sidebar a:hover,
.sidebar a.active {
    background: rgba(255,255,255,0.1);
    color: var(--white);
    text-decoration: none;
}

.main-content { flex: 1; padding: 2rem; overflow-y: auto; }

/* --- Cards ------------------------------------------------- */
.card {
    background: var(--white);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}
.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}
.card-header h2 { font-size: 1.1rem; font-weight: 700; color: var(--primary); }

/* --- Quiz -------------------------------------------------- */
.quiz-option {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border: 1.5px solid var(--gray-100);
    border-radius: 8px;
    margin-bottom: 0.6rem;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
}
.quiz-option:hover   { border-color: var(--accent); background: #EEF2FF; }
.quiz-option.correct { border-color: var(--success); background: #EAF3DE; }
.quiz-option.wrong   { border-color: var(--danger);  background: #FCEBEB; }
.quiz-option input   { margin-top: 0.2rem; }

.quiz-progress {
    height: 6px;
    background: var(--gray-100);
    border-radius: 3px;
    margin-bottom: 1.5rem;
    overflow: hidden;
}
.quiz-progress-bar {
    height: 100%;
    background: var(--accent);
    border-radius: 3px;
    transition: width 0.3s;
}

/* --- Badge / Tag ------------------------------------------ */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
}
.badge-easy   { background: #EAF3DE; color: #27500A; }
.badge-medium { background: #FAEEDA; color: #633806; }
.badge-hard   { background: #FCEBEB; color: #791F1F; }

/* --- Responsive -------------------------------------------- */
/* --- Social Login Buttons ----------------------------------- */
.btn-social {
    display: flex; align-items: center; justify-content: center; gap: 0.75rem;
    padding: 0.75rem 1rem; border-radius: 8px; font-size: 0.9rem; font-weight: 600;
    text-decoration: none; transition: opacity 0.2s, transform 0.1s;
    cursor: pointer; border: 1.5px solid var(--gray-300);
}
.btn-social:hover { opacity: 0.9; transform: translateY(-1px); }
.btn-social:active { transform: translateY(0); }
.btn-google { background: #fff; color: #3c4043; }
.btn-facebook { background: #1877F2; color: #fff; border-color: #1877F2; }
.btn-linkedin { background: #0A66C2; color: #fff; border-color: #0A66C2; }

@media (max-width: 768px) {
    .app-layout { flex-direction: column; }
    .sidebar    { width: 100%; flex-direction: row; flex-wrap: wrap; padding: 0.75rem; }
    .sidebar-logo { padding: 0.25rem 0.5rem 0.25rem; }
    .sidebar-logo img { width: 28px; height: 28px; }
    .main-content { padding: 1rem; }
}
