/* Shared design system for the login and signup pages */

.text-stm-primary {
    color: #0d47a1 !important;
}
.btn-stm-primary {
    background-color: #0d47a1;
    border-color: #0d47a1;
    color: white;
}
.btn-stm-primary:hover {
    background-color: #1565c0;
    border-color: #1565c0;
    color: white;
}
.btn-stm-primary:disabled {
    opacity: 0.75;
}
.input-group-text {
    background-color: #f8f9fa;
    border-right: none;
    color: #0d47a1;
}
.form-control:focus {
    border-color: #0d47a1;
    box-shadow: 0 0 0 0.2rem rgba(13, 71, 161, 0.25);
}

/* Password visibility toggle button */
.password-toggle-btn {
    cursor: pointer;
}
.password-toggle-btn:focus {
    box-shadow: none;
}

/* Live password-match hint (signup) */
.password-match-hint {
    font-size: 0.85rem;
    margin-top: 0.35rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
    min-height: 1.2rem;
}
.password-match-hint.match {
    color: #1e6b3c;
}
.password-match-hint.no-match {
    color: #b02a37;
}

/* Password strength meter (signup) */
.password-strength {
    height: 4px;
    border-radius: 2px;
    margin-top: 0.5rem;
    background-color: #e9ecef;
    overflow: hidden;
}
.password-strength-bar {
    height: 100%;
    width: 0%;
    transition: width 0.2s ease, background-color 0.2s ease;
    background-color: #dc3545;
}
.password-strength-label {
    font-size: 0.8rem;
    color: #6c757d;
    margin-top: 0.25rem;
    display: block;
}

/* Designed inline alert (replaces browser alert() popups) */
.stm-alert {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 0.6rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    font-size: 0.92rem;
    animation: stmAlertIn 0.25s ease-out;
}

.stm-alert .bi {
    font-size: 1.2rem;
    line-height: 1;
    margin-top: 0.1rem;
}

.stm-alert-danger {
    background-color: #fdecea;
    border-color: #f5c6cb;
    color: #7a1f1f;
}

.stm-alert-warning {
    background-color: #fff8e6;
    border-color: #ffe6a3;
    color: #7a5a00;
}

.stm-alert-success {
    background-color: #e9f7ef;
    border-color: #b8e6c9;
    color: #1e6b3c;
}

.stm-alert-info {
    background-color: #eaf4fb;
    border-color: #bfe0f5;
    color: #1c5a80;
}

.stm-alert .stm-alert-close {
    margin-left: auto;
    background: none;
    border: none;
    color: inherit;
    opacity: 0.6;
    font-size: 1rem;
    line-height: 1;
    cursor: pointer;
}

.stm-alert .stm-alert-close:hover {
    opacity: 1;
}

.shake {
    animation: stmShake 0.35s;
}

@keyframes stmAlertIn {
    from { opacity: 0; transform: translateY(-6px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes stmShake {
    10%, 90% { transform: translateX(-1px); }
    20%, 80% { transform: translateX(2px); }
    30%, 50%, 70% { transform: translateX(-4px); }
    40%, 60% { transform: translateX(4px); }
}

/* Card entrance animation */
.auth-card {
    animation: stmCardIn 0.35s ease-out;
}
@keyframes stmCardIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Dark mode */
body.dark-mode .card {
    background-color: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

body.dark-mode .card-body {
    color: white;
}

body.dark-mode .form-label {
    color: rgba(255, 255, 255, 0.9);
}

body.dark-mode .input-group-text {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    color: #42a5f5;
}

body.dark-mode .form-control {
    background-color: rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.1);
    color: white;
}

body.dark-mode .form-control:focus {
    background-color: rgba(0, 0, 0, 0.4);
    border-color: #42a5f5;
    color: white;
}

body.dark-mode .form-control::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

body.dark-mode .text-muted {
    color: rgba(255, 255, 255, 0.6) !important;
}

body.dark-mode .form-check-label {
    color: white;
}

body.dark-mode .border-stm-primary {
    border-color: #42a5f5 !important;
}

body.dark-mode .stm-alert-danger {
    background-color: rgba(220, 53, 69, 0.15);
    border-color: rgba(220, 53, 69, 0.4);
    color: #ff8a8a;
}

body.dark-mode .stm-alert-warning {
    background-color: rgba(255, 193, 7, 0.15);
    border-color: rgba(255, 193, 7, 0.4);
    color: #ffd873;
}

body.dark-mode .stm-alert-success {
    background-color: rgba(40, 167, 69, 0.15);
    border-color: rgba(40, 167, 69, 0.4);
    color: #7be0a0;
}

body.dark-mode .stm-alert-info {
    background-color: rgba(23, 162, 184, 0.15);
    border-color: rgba(23, 162, 184, 0.4);
    color: #7fd6ec;
}

body.dark-mode .password-strength {
    background-color: rgba(255, 255, 255, 0.1);
}

body.dark-mode .password-strength-label {
    color: rgba(255, 255, 255, 0.6);
}
