/* =============================================================================
   Sophro Audio v2 - Styles frontend complets
   Design minimaliste et discret, palette neutre, beaucoup d'air
   ============================================================================= */

/* ----- Reset léger sur le conteneur ----- */
.sophro-app,
.sophro-single {
    max-width: 860px;
    margin: 2rem auto;
    padding: 1.5rem;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #2d3748;
    line-height: 1.5;
}

.sophro-app h1, .sophro-app h2, .sophro-app h3,
.sophro-single h1, .sophro-single h2, .sophro-single h3 {
    color: #1a202c;
    font-weight: 600;
    margin: 0 0 0.5rem 0;
}

/* =============================================================================
   LOGIN
   ============================================================================= */
.sophro-login-box {
    max-width: 380px;
    margin: 3rem auto;
    padding: 2.5rem 2rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}

.sophro-login-box h2 {
    text-align: center;
    margin-bottom: 0.5rem;
    font-size: 1.4rem;
}

.sophro-login-intro {
    text-align: center;
    color: #718096;
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.sophro-login-box .login-username,
.sophro-login-box .login-password {
    margin-bottom: 1rem;
}

.sophro-login-box label {
    display: block;
    font-size: 0.85rem;
    font-weight: 500;
    margin-bottom: 0.35rem;
    color: #4a5568;
}

.sophro-login-box input[type="text"],
.sophro-login-box input[type="password"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.95rem;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.sophro-login-box input[type="text"]:focus,
.sophro-login-box input[type="password"]:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43,108,176,0.1);
}

.sophro-login-box .login-remember {
    margin-bottom: 1rem;
    font-size: 0.85rem;
    color: #718096;
}

.sophro-login-box .button-primary,
.sophro-login-box input[type="submit"] {
    width: 100%;
    padding: 0.7rem 1rem;
    background: #2b6cb0;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.15s;
}

.sophro-login-box .button-primary:hover,
.sophro-login-box input[type="submit"]:hover {
    background: #2c5282;
}

/* =============================================================================
   APP - Header
   ============================================================================= */
.sophro-app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 1.25rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid #e2e8f0;
}

.sophro-app-header h1 {
    margin: 0;
    font-size: 1.5rem;
}

.sophro-logout {
    color: #718096;
    text-decoration: none;
    font-size: 0.9rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    transition: all 0.15s;
}

.sophro-logout:hover {
    color: #2d3748;
    border-color: #cbd5e0;
    background: #f7fafc;
}

/* =============================================================================
   MESSAGES (succès / erreur)
   ============================================================================= */
.sophro-success {
    margin-bottom: 2rem;
    padding: 2rem;
    background: linear-gradient(135deg, #f0fff4 0%, #e6fffa 100%);
    border: 1px solid #9ae6b4;
    border-radius: 12px;
    text-align: center;
}

.sophro-success h2 {
    color: #22543d;
    margin-bottom: 0.75rem;
    font-size: 1.3rem;
}

.sophro-success-qr {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
}

.sophro-success-qr .sophro-qrcode-wrapper {
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px solid #c6f6d5;
}

.sophro-success-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 0.75rem;
}

.sophro-success-url {
    font-size: 0.8rem;
    color: #718096;
    margin: 0;
    word-break: break-all;
}

.sophro-error {
    padding: 0.85rem 1rem;
    background: #fed7d7;
    color: #742a2a;
    border: 1px solid #feb2b2;
    border-radius: 6px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* =============================================================================
   FORMULAIRE D'UPLOAD
   ============================================================================= */
.sophro-upload-section {
    margin-bottom: 2.5rem;
    padding: 1.75rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
}

.sophro-upload-section h2 {
    margin-bottom: 1.25rem;
    font-size: 1.2rem;
}

.sophro-field {
    margin-bottom: 1.1rem;
}

.sophro-field label {
    display: block;
    font-size: 0.88rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
    color: #4a5568;
}

.sophro-field input[type="text"],
.sophro-field textarea,
.sophro-field input[type="file"] {
    width: 100%;
    padding: 0.65rem 0.85rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.95rem;
    font-family: inherit;
    box-sizing: border-box;
    transition: border-color 0.15s;
}

.sophro-field input[type="file"] {
    padding: 0.5rem;
    background: #f7fafc;
    cursor: pointer;
}

.sophro-field input[type="text"]:focus,
.sophro-field textarea:focus {
    outline: none;
    border-color: #2b6cb0;
    box-shadow: 0 0 0 3px rgba(43,108,176,0.1);
}

.sophro-field textarea {
    resize: vertical;
    min-height: 70px;
}

.sophro-field small {
    display: block;
    margin-top: 0.35rem;
    color: #a0aec0;
    font-size: 0.8rem;
}

/* =============================================================================
   LISTE DES SÉANCES
   ============================================================================= */
.sophro-list-section {
    margin-top: 2rem;
}

.sophro-list-section h2 {
    margin-bottom: 1.25rem;
    font-size: 1.2rem;
}

.sophro-empty {
    padding: 2rem;
    text-align: center;
    color: #a0aec0;
    background: #f7fafc;
    border-radius: 8px;
    border: 1px dashed #cbd5e0;
}

.sophro-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.sophro-card {
    display: flex;
    gap: 1.25rem;
    padding: 1.25rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.sophro-card:hover {
    border-color: #cbd5e0;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.sophro-card-info {
    flex: 1;
    min-width: 0; /* permet au text-overflow de fonctionner */
}

.sophro-card-info h3 {
    margin: 0 0 0.3rem 0;
    font-size: 1rem;
}

.sophro-card-info h3 a {
    color: #1a202c;
    text-decoration: none;
}

.sophro-card-info h3 a:hover {
    color: #2b6cb0;
    text-decoration: underline;
}

.sophro-card-meta {
    font-size: 0.8rem;
    color: #a0aec0;
    margin: 0 0 0.35rem 0;
}

.sophro-card-url {
    font-size: 0.78rem;
    color: #718096;
    margin: 0 0 0.85rem 0;
    word-break: break-all;
}

.sophro-card-actions {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
}

.sophro-card-qr {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
}

.sophro-card-qr .sophro-qrcode-wrapper {
    padding: 0.4rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
}

/* =============================================================================
   BOUTONS (système unifié)
   ============================================================================= */
.sophro-btn {
    display: inline-block;
    padding: 0.55rem 1.1rem;
    background: #2b6cb0;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 0.88rem;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.15s, transform 0.05s;
    font-family: inherit;
}

.sophro-btn:hover {
    background: #2c5282;
    color: #fff;
    text-decoration: none;
}

.sophro-btn:active {
    transform: scale(0.98);
}

.sophro-btn-primary {
    padding: 0.75rem 1.5rem;
    font-size: 0.95rem;
}

.sophro-btn-secondary {
    background: #718096;
}

.sophro-btn-secondary:hover {
    background: #4a5568;
}

.sophro-btn-danger {
    background: #c53030;
}

.sophro-btn-danger:hover {
    background: #9b2c2c;
}

.sophro-btn-small {
    padding: 0.35rem 0.7rem;
    font-size: 0.78rem;
}

.sophro-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* =============================================================================
   PAGE SINGLE D'UNE SÉANCE
   ============================================================================= */
.sophro-article .sophro-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e2e8f0;
}

.sophro-title {
    font-size: 2rem;
    margin: 0 0 0.75rem 0;
    line-height: 1.2;
}

.sophro-excerpt {
    font-size: 1rem;
    color: #4a5568;
    margin: 0;
}

.sophro-thumbnail img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin-top: 1rem;
}

.sophro-content {
    margin-bottom: 2.5rem;
    line-height: 1.7;
}

.sophro-content audio {
    width: 100%;
    margin: 1rem 0;
}

.sophro-qr {
    margin-top: 2.5rem;
    padding: 2rem;
    background: #f7fafc;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    text-align: center;
}

.sophro-qr h2 {
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.sophro-qr-intro {
    color: #718096;
    margin: 0 0 1.5rem 0;
    font-size: 0.9rem;
}

.sophro-qr-box {
    display: inline-block;
    padding: 1rem;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    margin-bottom: 1.5rem;
}

#sophro-qrcode {
    display: inline-block;
}

#sophro-qrcode img,
#sophro-qrcode canvas {
    display: block;
}

.sophro-qr-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}

.sophro-qr-url {
    font-size: 0.82rem;
    color: #718096;
    margin: 1rem 0 0 0;
    word-break: break-all;
}

.sophro-qr-url a {
    color: #2b6cb0;
    text-decoration: none;
}

/* =============================================================================
   QR CODE wrapper (générique pour le shortcode)
   ============================================================================= */
.sophro-qrcode-wrapper {
    display: inline-block;
}

.sophro-qrcode-wrapper canvas,
.sophro-qrcode-wrapper img {
    display: block;
}

/* =============================================================================
   RESPONSIVE
   ============================================================================= */
@media (max-width: 640px) {
    .sophro-app, .sophro-single {
        margin: 1rem auto;
        padding: 1rem;
    }
    .sophro-card {
        flex-direction: column;
        align-items: stretch;
    }
    .sophro-card-qr {
        align-self: center;
    }
    .sophro-app-header {
        flex-direction: column;
        gap: 0.75rem;
        align-items: flex-start;
    }
    .sophro-title {
        font-size: 1.5rem;
    }
}
