/**
 * Styles for SMS Login plugin.
 *
 * @package    local_smslogin
 * @copyright  2025 TVET E-Learning Platform
 * @license    http://www.gnu.org/copyleft/gpl.html GNU GPL v3 or later
 */

/* Container */
.smslogin-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: calc(100vh - 200px);
    padding: 40px 20px;
}

/* Card */
.smslogin-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
    max-width: 480px;
    width: 100%;
    padding: 40px;
    margin: 0 auto;
}

/* Header */
.smslogin-header {
    text-align: center;
    margin-bottom: 30px;
}

.smslogin-logo {
    max-width: 120px;
    height: auto;
    margin-bottom: 20px;
}

.smslogin-header h2 {
    color: #1a237e;
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 10px;
}

.smslogin-subtitle {
    color: #666;
    font-size: 14px;
    margin-bottom: 0;
}

/* Progress Steps */
.smslogin-steps {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
    padding: 0 20px;
}

.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #e0e0e0;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 14px;
    transition: all 0.3s ease;
}

.step.active .step-number {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    color: #fff;
}

.step-label {
    font-size: 11px;
    color: #999;
    margin-top: 8px;
    text-align: center;
    white-space: nowrap;
}

.step.active .step-label {
    color: #1a237e;
    font-weight: 600;
}

.step-line {
    width: 60px;
    height: 3px;
    background: #e0e0e0;
    margin: 0 10px;
    margin-bottom: 20px;
    transition: all 0.3s ease;
}

.step-line.active {
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
}

/* Form */
.smslogin-form {
    margin-bottom: 20px;
}

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

.smslogin-form label {
    display: block;
    color: #333;
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 8px;
}

.smslogin-form .form-control {
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    padding: 12px 16px;
    font-size: 15px;
    transition: all 0.3s ease;
}

.smslogin-form .form-control:focus {
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
}

.smslogin-form .form-control.is-valid {
    border-color: #4caf50;
}

.smslogin-form .form-control.is-invalid {
    border-color: #f44336;
}

.smslogin-form .input-group-text {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-right: none;
    border-radius: 10px 0 0 10px;
    color: #666;
    font-weight: 500;
}

.smslogin-form .input-group .form-control {
    border-radius: 0 10px 10px 0;
}

.smslogin-form .form-text {
    font-size: 12px;
    margin-top: 6px;
}

/* OTP Input */
.otp-input-group {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.otp-input {
    width: 50px;
    height: 60px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    text-align: center;
    font-size: 24px;
    font-weight: 700;
    color: #1a237e;
    transition: all 0.3s ease;
}

.otp-input:focus {
    border-color: #1a237e;
    box-shadow: 0 0 0 3px rgba(26, 35, 126, 0.1);
    outline: none;
}

.otp-instruction {
    text-align: center;
    color: #666;
    margin-bottom: 10px;
}

.otp-phone-display {
    text-align: center;
    margin-bottom: 20px;
}

.otp-phone-display strong {
    color: #1a237e;
    font-size: 16px;
}

.otp-timer {
    text-align: center;
    margin-bottom: 20px;
    color: #666;
}

#timer-countdown {
    font-weight: 700;
    color: #f57c00;
    font-size: 18px;
}

.resend-otp {
    text-align: center;
}

#resend-otp {
    color: #1a237e;
    font-weight: 600;
    text-decoration: none;
}

#resend-otp:hover {
    text-decoration: underline;
}

/* Button */
.smslogin-btn {
    width: 100%;
    padding: 14px 24px;
    background: linear-gradient(135deg, #1a237e 0%, #3949ab 100%);
    border: none;
    border-radius: 10px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.smslogin-btn:hover {
    background: linear-gradient(135deg, #0d1259 0%, #283593 100%);
    transform: translateY(-2px);
    box-shadow: 0 5px 20px rgba(26, 35, 126, 0.3);
}

.smslogin-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.btn-loading i {
    margin-right: 8px;
}

/* Toggle password */
.toggle-password {
    border: 2px solid #e0e0e0;
    border-left: none;
    border-radius: 0 10px 10px 0;
    background: #f5f5f5;
}

.toggle-password:hover {
    background: #e0e0e0;
}

/* Steps visibility */
.smslogin-step {
    display: none;
}

.smslogin-step.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Alert */
#smslogin-alert {
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 20px;
    font-size: 14px;
}

/* Footer */
.smslogin-footer {
    text-align: center;
    padding-top: 20px;
    border-top: 1px solid #e0e0e0;
}

.smslogin-footer p {
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.smslogin-footer a {
    color: #1a237e;
    font-weight: 600;
    text-decoration: none;
}

.smslogin-footer a:hover {
    text-decoration: underline;
}

/* Login page specific */
.smslogin-divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
}

.smslogin-divider::before,
.smslogin-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e0e0e0;
}

.smslogin-divider span {
    padding: 0 15px;
    color: #999;
    font-size: 13px;
}

/* Responsive */
@media (max-width: 576px) {
    .smslogin-container {
        padding: 20px 15px;
    }

    .smslogin-card {
        padding: 30px 20px;
    }

    .otp-input {
        width: 40px;
        height: 50px;
        font-size: 20px;
    }

    .step-line {
        width: 30px;
    }

    .step-label {
        font-size: 10px;
    }
}

/* Login button on main login page */
.smslogin-link {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px 20px;
    background: #fff;
    border: 2px solid #1a237e;
    border-radius: 10px;
    color: #1a237e;
    font-weight: 600;
    text-decoration: none;
    margin-top: 15px;
    transition: all 0.3s ease;
}

.smslogin-link:hover {
    background: #1a237e;
    color: #fff;
    text-decoration: none;
}

.smslogin-link i {
    margin-right: 10px;
    font-size: 18px;
}
