/* -- Overlay ------------------------------------------------- */

#smr-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: smrFadeIn 0.25s ease;
    padding: 20px;
    box-sizing: border-box;
}

/* -- Modal ---------------------------------------------------- */

#smr-modal {
    background: #1a1a1a;
    color: #fff;
    border-radius: 16px;
    width: 100%;
    max-width: 420px;
    padding: 32px 28px 24px;
    position: relative;
    animation: smrSlideUp 0.3s ease;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

/* -- Close button --------------------------------------------- */

#smr-close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: none;
    border: none;
    color: #888;
    font-size: 24px;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.2s;
}

#smr-close:hover {
    color: #fff;
}

/* -- Header --------------------------------------------------- */

#smr-header {
    text-align: center;
    margin-bottom: 16px;
}

#smr-icon {
    font-size: 32px;
    margin-bottom: 8px;
    color: #ff8c00;
}

#smr-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 6px;
}

#smr-subtitle {
    font-size: 13px;
    color: #999;
}

/* -- Divider -------------------------------------------------- */

#smr-divider {
    height: 1px;
    background: #333;
    margin: 16px 0;
}

/* -- Form ----------------------------------------------------- */

#smr-form label {
    display: block;
    font-size: 12px;
    color: #aaa;
    margin-bottom: 4px;
    font-weight: 500;
}

#smr-form .smr-req {
    color: #ff8c00;
}

#smr-form input[type="text"],
#smr-form input[type="email"],
#smr-form input[type="password"] {
    display: block;
    width: 100%;
    padding: 10px 12px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    margin-bottom: 12px;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}

#smr-form input:focus {
    border-color: #ff8c00;
}

#smr-form input::placeholder {
    color: #666;
}

/* -- Name row (side by side) ---------------------------------- */

.smr-row {
    display: flex;
    gap: 12px;
}

.smr-field {
    flex: 1;
}

/* -- Error message -------------------------------------------- */

#smr-error {
    background: #3a1a1a;
    color: #ff6b6b;
    border: 1px solid #5a2a2a;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    margin-bottom: 12px;
    text-align: center;
}

/* -- Submit button -------------------------------------------- */

#smr-submit {
    display: block;
    width: 100%;
    padding: 12px;
    background: #ff8c00;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    margin-top: 4px;
    transition: background 0.2s, opacity 0.2s;
    font-family: inherit;
}

#smr-submit:hover:not(:disabled) {
    background: #e67e00;
}

#smr-submit:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

/* -- Cancel button -------------------------------------------- */

#smr-cancel {
    display: block;
    width: 100%;
    text-align: center;
    background: none;
    border: none;
    color: #888;
    font-size: 13px;
    cursor: pointer;
    padding: 12px 0 0;
    transition: color 0.2s;
    font-family: inherit;
}

#smr-cancel:hover {
    color: #ccc;
}

/* -- Already logged in ---------------------------------------- */

#smr-logged-in {
    text-align: center;
    padding: 24px 0 12px;
}

#smr-logged-icon {
    font-size: 48px;
    color: #4caf50;
    margin-bottom: 12px;
}

#smr-logged-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 16px;
}

/* -- Success -------------------------------------------------- */

#smr-success {
    text-align: center;
    padding: 24px 0 12px;
}

#smr-success-icon {
    font-size: 48px;
    color: #4caf50;
    margin-bottom: 12px;
}

#smr-success-text {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

#smr-success-sub {
    font-size: 13px;
    color: #999;
    margin-bottom: 16px;
}

/* -- Forum link ----------------------------------------------- */

#smr-forum-link,
#smr-success-forum {
    display: inline-block;
    color: #ff8c00;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

#smr-forum-link:hover,
#smr-success-forum:hover {
    color: #e67e00;
}

/* -- Animations ----------------------------------------------- */

@keyframes smrFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes smrSlideUp {
    from { opacity: 0; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* -- Tablet --------------------------------------------------- */

@media (max-width: 768px) {
    #smr-modal {
        max-width: 90%;
    }
}

/* -- Mobile (bottom sheet) ------------------------------------ */

@media (max-width: 480px) {
    #smr-overlay {
        align-items: flex-end;
        padding: 0;
    }

    #smr-modal {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
        padding: 28px 20px 24px;
        animation: smrSlideUpMobile 0.3s ease;
    }

    .smr-row {
        flex-direction: column;
        gap: 0;
    }

    @keyframes smrSlideUpMobile {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }
}
