/**
 * Allgot Lösenordsåterställning - CSS Stylesheet
 * Professionell och responsiv design för svenska lärare
 */

.allgot-pwd-reset-container {
    max-width: 500px;
    margin: 20px auto;
    padding: 30px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    font-family: 'Segoe UI', Arial, sans-serif;
    color: #333;
}

.allgot-pwd-reset-container h3 {
    color: #2c5f2d;
    text-align: center;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
}

.allgot-pwd-reset-container h4 {
    color: #2c5f2d;
    margin-bottom: 15px;
    font-size: 20px;
    font-weight: 600;
}

.allgot-form-section {
    margin-bottom: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #444;
    font-size: 14px;
}

.form-control {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e1e1;
    border-radius: 6px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
}

.form-control:focus {
    outline: none;
    border-color: #2c5f2d;
    box-shadow: 0 0 0 3px rgba(44, 95, 45, 0.1);
}

.form-control:invalid {
    border-color: #dc3545;
}

.btn {
    display: inline-block;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.1s ease;
    min-width: 200px;
}

.btn-primary {
    background-color: #2c5f2d;
    color: white;
}

.btn-primary:hover {
    background-color: #1e4220;
    transform: translateY(-1px);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
    transform: none;
}

.message-area {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 6px;
    font-size: 14px;
    display: none;
}

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

.message-error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
    display: block;
}

.message-info {
    background-color: #d1ecf1;
    color: #0c5460;
    border: 1px solid #bee5eb;
    display: block;
}

.login-link {
    text-align: center;
    margin-top: 25px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.login-link a {
    color: #2c5f2d;
    text-decoration: none;
    font-weight: 500;
}

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

small {
    display: block;
    margin-top: 5px;
    color: #666;
    font-size: 12px;
}

/* Loading spinner */
.loading {
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e1e1e1;
    border-top: 2px solid #2c5f2d;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: translateY(-50%) rotate(0deg); }
    100% { transform: translateY(-50%) rotate(360deg); }
}

/* Responsive design */
@media (max-width: 768px) {
    .allgot-pwd-reset-container {
        margin: 10px;
        padding: 20px;
    }
    
    .form-control {
        font-size: 16px; /* Förhindra zoom på iOS */
    }
    
    .btn {
        width: 100%;
        min-width: auto;
    }
}

@media (max-width: 480px) {
    .allgot-pwd-reset-container {
        margin: 5px;
        padding: 15px;
    }
    
    .allgot-pwd-reset-container h3 {
        font-size: 20px;
    }
    
    .allgot-pwd-reset-container h4 {
        font-size: 18px;
    }
}

/* Tillgänglighet */
@media (prefers-reduced-motion: reduce) {
    .form-control,
    .btn,
    .loading::after {
        transition: none;
        animation: none;
    }
}

/* Fokushantering för tangentbordsnavigering */
.form-control:focus-visible,
.btn:focus-visible {
    outline: 2px solid #2c5f2d;
    outline-offset: 2px;
}

/* Skärmlässare */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Validering */
.form-group.has-error .form-control {
    border-color: #dc3545;
}

.form-group.has-error .error-message {
    display: block;
    color: #dc3545;
    font-size: 12px;
    margin-top: 5px;
}

.form-group.has-success .form-control {
    border-color: #28a745;
}

/* Progress indicator */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 30px;
    padding: 0 20px;
}

.progress-step {
    flex: 1;
    text-align: center;
    position: relative;
    color: #999;
    font-size: 12px;
}

.progress-step.active {
    color: #2c5f2d;
    font-weight: 600;
}

.progress-step.completed {
    color: #28a745;
}

.progress-step::before {
    content: '';
    display: block;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #e1e1e1;
    margin: 0 auto 8px;
}

.progress-step.active::before {
    background: #2c5f2d;
}

.progress-step.completed::before {
    background: #28a745;
}

/* Animation för formulärbyten */
.form-section-enter {
    opacity: 0;
    transform: translateY(20px);
}

.form-section-enter-active {
    opacity: 1;
    transform: translateY(0);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.form-section-exit {
    opacity: 1;
    transform: translateY(0);
}

.form-section-exit-active {
    opacity: 0;
    transform: translateY(-20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
}