/* static/css/auth_style.css */
/* Enhetlig styling för alla autentiseringssidor */

body.auth-page {
    font-family: 'Open Sans', sans-serif;
    background-color: #e9ebee;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    color: #444;
}

/* =============================================
   CONTAINER & KORT
   ============================================= */
.auth-page-container {
    width: 100%;
    padding: 20px;
    box-sizing: border-box;
}

.auth-card {
    background-color: #ffffff;
    padding: 35px 45px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 450px;
    margin: 0 auto;
    text-align: center;
}

/* =============================================
   LOGO & RUBRIKER
   ============================================= */
.auth-logo-area {
    margin-bottom: 25px;
}

.auth-app-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.2em;
    color: #3f6e2d;
    font-weight: 700;
    margin: 0;
}

.auth-header {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5em;
    color: #333;
    margin-bottom: 10px;
    font-weight: 600;
}

.auth-subtitle {
    font-size: 0.95em;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

/* =============================================
   MEDDELANDEN
   ============================================= */
.auth-error-message,
.auth-info-message,
.auth-success-message {
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 5px;
    font-size: 0.95em;
    text-align: left;
}

.auth-error-message {
    background-color: #fddede;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.auth-info-message {
    background-color: #e2f3fb;
    color: #0c5460;
    border: 1px solid #bee5eb;
}

.auth-success-message {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* =============================================
   FORMULÄR
   ============================================= */
.auth-form {
    text-align: left;
}

.auth-form .form-field-group {
    margin-bottom: 20px;
}

.auth-form label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #555;
}

.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input[type="number"] {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 5px;
    box-sizing: border-box;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.auth-form input:focus {
    border-color: #3f6e2d;
    outline: none;
    box-shadow: 0 0 0 0.2rem rgba(63, 110, 45, 0.25);
}

.auth-form .error-message {
    color: #721c24;
    font-size: 0.85em;
    margin-top: 5px;
}

/* =============================================
   KNAPPAR
   ============================================= */
.auth-form .form-actions-group {
    margin-top: 25px;
}

.btn-primary {
    background-color: #3f6e2d;
    color: white;
    padding: 14px 20px;
    border: none;
    border-radius: 5px;
    font-size: 1.1em;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
}

.btn-primary:hover {
    background-color: #305321;
}

.btn-secondary {
    background-color: #6c757d;
    color: white;
    padding: 12px 18px;
    border: none;
    border-radius: 5px;
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    display: inline-block;
    text-align: center;
    text-decoration: none;
    box-sizing: border-box;
    margin-top: 10px;
}

.btn-secondary:hover {
    background-color: #545b62;
}

/* =============================================
   LÄNKAR
   ============================================= */
.auth-link {
    margin-top: 20px;
    font-size: 0.9em;
    text-align: center;
}

.auth-link a {
    color: #3f6e2d;
    text-decoration: none;
}

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

/* =============================================
   MFA-SPECIFIKT
   ============================================= */
.qr-code-wrapper {
    margin: 25px 0;
    padding: 20px;
    background-color: #f8f9fa;
    border-radius: 8px;
    display: inline-block;
}

.qr-code-wrapper img {
    max-width: 200px;
    height: auto;
}

.manual-key {
    margin: 20px 0;
    text-align: left;
}

.manual-key summary {
    cursor: pointer;
    color: #3f6e2d;
    font-size: 0.9em;
    font-weight: 600;
}

.manual-key summary:hover {
    text-decoration: underline;
}

.manual-key code {
    display: block;
    margin-top: 10px;
    padding: 12px 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 5px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    word-break: break-all;
    color: #333;
}

/* OTP-input styling */
.otp-input {
    text-align: center;
    font-size: 1.5em !important;
    letter-spacing: 0.5em;
    font-weight: 600;
}

/* =============================================
   PROFILSIDA
   ============================================= */
.profile-card {
    background-color: #ffffff;
    padding: 35px 45px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

.profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.profile-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background-color: #3f6e2d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2em;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    margin-right: 20px;
}

.profile-name {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.5em;
    color: #333;
    margin: 0 0 5px 0;
}

.profile-email {
    color: #666;
    font-size: 0.95em;
    margin: 0;
}

.profile-section {
    margin-bottom: 25px;
}

.profile-section-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 1.1em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
}

.profile-info-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.profile-info-row:last-child {
    border-bottom: none;
}

.profile-info-label {
    color: #666;
    font-size: 0.9em;
}

.profile-info-value {
    color: #333;
    font-weight: 600;
}

.profile-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-actions .btn-primary,
.profile-actions .btn-secondary {
    width: 100%;
}

/* MFA-status */
.mfa-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.mfa-status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.mfa-status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.mfa-status-badge.inactive {
    background-color: #fddede;
    color: #721c24;
}

/* =============================================
   RESPONSIVITET
   ============================================= */
@media (max-width: 480px) {
    .auth-card,
    .profile-card {
        padding: 25px 20px;
        margin: 10px;
    }
    
    .auth-app-title {
        font-size: 1.8em;
    }
    
    .auth-header {
        font-size: 1.3em;
    }
    
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 15px;
    }
}
/* =============================================
   PROFILSIDA INOM KALLE-LAYOUT
   ============================================= */
.profile-page-wrapper {
    display: flex;
    justify-content: center;
    padding: 40px 20px;
}

.profile-page-wrapper .profile-card {
    background-color: #ffffff;
    padding: 35px 45px;
    border-radius: 10px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    width: 100%;
    max-width: 500px;
}

.profile-page-wrapper .profile-header {
    display: flex;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.profile-page-wrapper .profile-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #3f6e2d;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8em;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    margin-right: 20px;
    flex-shrink: 0;
}

.profile-page-wrapper .profile-name {
    font-family: 'Inter', sans-serif;
    font-size: 1.4em;
    color: #333;
    margin: 0 0 5px 0;
    font-weight: 600;
}

.profile-page-wrapper .profile-email {
    color: #666;
    font-size: 0.9em;
    margin: 0;
}

.profile-page-wrapper .profile-section {
    margin-bottom: 25px;
}

.profile-page-wrapper .profile-section-title {
    font-family: 'Inter', sans-serif;
    font-size: 1em;
    color: #333;
    margin-bottom: 15px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-size: 0.85em;
}

.profile-page-wrapper .profile-info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.profile-page-wrapper .profile-info-row:last-child {
    border-bottom: none;
}

.profile-page-wrapper .profile-info-label {
    color: #666;
    font-size: 0.9em;
}

.profile-page-wrapper .profile-info-value {
    color: #333;
    font-weight: 500;
}

.profile-page-wrapper .mfa-status-badge {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8em;
    font-weight: 600;
}

.profile-page-wrapper .mfa-status-badge.active {
    background-color: #d4edda;
    color: #155724;
}

.profile-page-wrapper .mfa-status-badge.inactive {
    background-color: #fddede;
    color: #721c24;
}

.profile-page-wrapper .profile-actions {
    margin-top: 30px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.profile-page-wrapper .btn-primary,
.profile-page-wrapper .btn-secondary {
    padding: 12px 20px;
    border: none;
    border-radius: 6px;
    font-size: 0.95em;
    font-weight: 600;
    cursor: pointer;
    text-align: center;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.profile-page-wrapper .btn-primary {
    background-color: #3f6e2d;
    color: white;
}

.profile-page-wrapper .btn-primary:hover {
    background-color: #305321;
}

.profile-page-wrapper .btn-secondary {
    background-color: #6c757d;
    color: white;
}

.profile-page-wrapper .btn-secondary:hover {
    background-color: #545b62;
}

/* =============================================
   PASSWORD CHANGE FORM INOM KALLE
   ============================================= */
.profile-page-wrapper .password-change-form {
    margin-top: 20px;
}

.profile-page-wrapper .form-field-group {
    margin-bottom: 20px;
}

.profile-page-wrapper .form-field-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 0.9em;
    color: #555;
}

.profile-page-wrapper .form-field-group input {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ced4da;
    border-radius: 6px;
    box-sizing: border-box;
    font-size: 1em;
    font-family: inherit;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.profile-page-wrapper .form-field-group input:focus {
    border-color: #3f6e2d;
    outline: none;
    box-shadow: 0 0 0 3px rgba(63, 110, 45, 0.15);
}

.profile-page-wrapper .field-error {
    color: #dc3545;
    font-size: 0.85em;
    margin-top: 6px;
}

.profile-page-wrapper .success-message {
    background-color: #d4edda;
    color: #155724;
    padding: 16px 20px;
    border-radius: 8px;
    font-weight: 500;
    text-align: center;
    margin: 20px 0;
}

/* =================================================================== */
/* AUTH & PROFIL - MOBIL RESPONSIVITET
/* =================================================================== */

@media (max-width: 576px) {
    
    /* --- Container --- */
    .auth-page-container {
        padding: 15px;
        min-height: 100vh;
        min-height: 100dvh;
        display: flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
    }
    
    /* --- Kort --- */
    .auth-card,
    .profile-card {
        width: 100%;
        max-width: 100%;
        padding: 30px 20px;
        margin: 0;
        border-radius: 12px;
        box-sizing: border-box;
    }
    
    /* --- Rubriker --- */
    .auth-app-title {
        font-size: 1.6em;
        text-align: center;
        margin-bottom: 8px;
    }
    
    .auth-header {
        font-size: 1.2em;
        text-align: center;
        margin-bottom: 20px;
    }
    
    .auth-subtitle {
        font-size: 0.9em;
        text-align: center;
        margin-bottom: 20px;
    }
    
    /* --- Info/Error meddelanden --- */
    .auth-info-message,
    .auth-error-message,
    .auth-success-message {
        padding: 12px 15px;
        font-size: 0.9em;
        margin-bottom: 20px;
        border-radius: 8px;
    }
    
    /* --- Form field groups --- */
    .form-field-group {
        margin-bottom: 16px;
    }
    
    .form-field-group label {
        display: block;
        font-size: 0.9em;
        margin-bottom: 6px;
        font-weight: 500;
    }
    
    /* --- Formulär inputs --- */
    .auth-form input[type="text"],
    .auth-form input[type="email"],
    .auth-form input[type="password"],
    .auth-form input[type="number"],
    .form-field-group input {
        width: 100%;
        padding: 14px 12px;
        font-size: 16px; /* Förhindrar zoom på iOS */
        border-radius: 6px;
        box-sizing: border-box;
    }
    
    /* --- OTP-input --- */
    .otp-input,
    #id_otp_code,
    input[name="otp_code"] {
        width: 100%;
        font-size: 1.5em !important;
        letter-spacing: 0.4em;
        padding: 14px 10px !important;
        text-align: center;
        box-sizing: border-box;
    }
    
    /* --- Knappar --- */
    .btn-primary,
    .btn-secondary,
    .auth-form button[type="submit"] {
        width: 100%;
        padding: 14px 18px;
        font-size: 1em;
        border-radius: 8px;
        box-sizing: border-box;
    }
    
    /* --- Form actions --- */
    .form-actions-group {
        margin-top: 20px;
    }
    
    /* --- Länkar --- */
    .auth-link {
        margin-top: 20px;
        text-align: center;
        font-size: 0.95em;
    }
    
    /* --- QR-kod (MFA) --- */
    .qr-code-wrapper {
        padding: 15px;
        margin: 20px 0;
        text-align: center;
    }
    
    .qr-code-wrapper img {
        max-width: 180px;
        height: auto;
    }
    
    .manual-key {
        margin-top: 15px;
    }
    
    .manual-key code {
        font-size: 0.75em;
        padding: 10px 12px;
        word-break: break-all;
        display: block;
    }
    
    /* --- Profil --- */
    .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-avatar {
        margin-right: 0;
        margin-bottom: 15px;
        width: 70px;
        height: 70px;
        font-size: 1.6em;
    }
    
    .profile-name {
        font-size: 1.3em;
    }
    
    .profile-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .profile-info-label {
        font-size: 0.8em;
    }
    
    .profile-info-value {
        font-size: 0.95em;
    }
    
    /* --- MFA Status --- */
    .mfa-status {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .mfa-status .btn-primary,
    .mfa-status .btn-secondary {
        width: 100%;
    }
}

/* Extra små skärmar (iPhone SE, äldre telefoner) */
@media (max-width: 360px) {
    
    .auth-page-container {
        padding: 10px;
    }
    
    .auth-card,
    .profile-card {
        padding: 25px 15px;
        border-radius: 10px;
    }
    
    .auth-app-title {
        font-size: 1.4em;
    }
    
    .auth-header {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .auth-form input[type="text"],
    .auth-form input[type="email"],
    .auth-form input[type="password"],
    .auth-form input[type="number"],
    .form-field-group input {
        padding: 12px 10px;
    }
    
    .otp-input,
    #id_otp_code,
    input[name="otp_code"] {
        font-size: 1.3em !important;
        letter-spacing: 0.3em;
    }
    
    .qr-code-wrapper img {
        max-width: 150px;
    }
    
    .profile-avatar {
        width: 60px;
        height: 60px;
        font-size: 1.4em;
    }
}

/* Landscape-läge på mobil */
@media (max-width: 576px) and (orientation: landscape) {
    .auth-page-container {
        padding: 10px 20px;
        min-height: auto;
        align-items: flex-start;
    }
    
    .auth-card,
    .profile-card {
        padding: 20px;
        max-width: 400px;
        margin: 10px auto;
    }
    
    .auth-header {
        font-size: 1.1em;
        margin-bottom: 15px;
    }
    
    .qr-code-wrapper img {
        max-width: 120px;
    }
}

/* =================================================================== */
/* PROFIL INOM KALLE - RESPONSIVITET
/* =================================================================== */

@media (max-width: 576px) {
    
    .profile-page-wrapper {
        padding: 15px;
        box-sizing: border-box;
    }
    
    .profile-page-wrapper .profile-card {
        width: 100%;
        padding: 25px 20px;
        margin: 0;
        box-sizing: border-box;
    }
    
    .profile-page-wrapper .profile-header {
        flex-direction: column;
        text-align: center;
    }
    
    .profile-page-wrapper .profile-avatar {
        margin-right: 0;
        margin-bottom: 15px;
        width: 60px;
        height: 60px;
        font-size: 1.5em;
    }
    
    .profile-page-wrapper .profile-name {
        font-size: 1.2em;
    }
    
    .profile-page-wrapper .profile-info-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
    
    .profile-page-wrapper .form-field-group input {
        width: 100%;
        padding: 14px 12px;
        font-size: 16px;
        box-sizing: border-box;
    }
    
    .profile-page-wrapper .btn-primary,
    .profile-page-wrapper .btn-secondary {
        width: 100%;
        padding: 14px 18px;
        font-size: 0.95em;
    }
}