* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    min-height: 100vh;
}

.container {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
}

h1 {
    text-align: center;
    margin-bottom: 2rem;
    color: #00d4ff;
}

h2 {
    margin-bottom: 1rem;
    color: #ccc;
}

.tabs {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.tab {
    flex: 1;
    padding: 0.75rem;
    background: #16213e;
    border: none;
    color: #888;
    cursor: pointer;
    border-radius: 8px;
    font-size: 1rem;
    transition: all 0.2s;
}

.tab:hover {
    background: #1f3460;
}

.tab.active {
    background: #0f3460;
    color: #00d4ff;
}

.auth-form {
    background: #16213e;
    padding: 2rem;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    color: #aaa;
}

.form-group small {
    display: block;
    margin-top: 0.25rem;
    color: #666;
    font-size: 0.8rem;
}

input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 0.75rem;
    background: #0f3460;
    border: 1px solid #1f4068;
    border-radius: 8px;
    color: #fff;
    font-size: 1rem;
}

input:focus {
    outline: none;
    border-color: #00d4ff;
}

.password-field {
    -webkit-text-security: disc;
}

button {
    padding: 0.75rem 1.5rem;
    background: #00d4ff;
    border: none;
    border-radius: 8px;
    color: #1a1a2e;
    font-weight: bold;
    cursor: pointer;
    font-size: 1rem;
    transition: background 0.2s;
}

button:hover {
    background: #00b8e6;
}

.auth-form button {
    width: 100%;
    margin-top: 1rem;
}

.hidden {
    display: none !important;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding: 1rem;
    background: #16213e;
    border-radius: 12px;
}

#logout-btn {
    background: #e94560;
}

#logout-btn:hover {
    background: #d63050;
}

.add-password {
    background: #16213e;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
}

.form-row {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.form-row input {
    flex: 1;
    min-width: 150px;
}

.form-row button {
    white-space: nowrap;
}

.passwords-list {
    background: #16213e;
    padding: 1.5rem;
    border-radius: 12px;
}

.password-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    background: #0f3460;
    border-radius: 8px;
    margin-bottom: 0.5rem;
}

.password-item:last-child {
    margin-bottom: 0;
}

.password-info {
    flex: 1;
}

.password-site {
    font-weight: bold;
    color: #00d4ff;
}

.password-username {
    color: #888;
    font-size: 0.9rem;
}

.password-value {
    font-family: monospace;
    background: #1a1a2e;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    min-width: 150px;
}

.password-actions {
    display: flex;
    gap: 0.4rem;
}

.btn-icon {
    width: 36px;
    height: 36px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.btn-icon img {
    width: 18px;
    height: 18px;
    filter: brightness(0) invert(1);
}

.btn-copy {
    background: #4caf50;
}

.btn-copy:hover {
    background: #43a047;
}

.btn-show {
    background: #9c27b0;
}

.btn-show:hover {
    background: #8e24aa;
}

.btn-edit {
    background: #ff9800;
}

.btn-edit:hover {
    background: #f57c00;
}

.btn-delete {
    background: #e94560;
}

.btn-delete:hover {
    background: #d63050;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: #16213e;
    padding: 2rem;
    border-radius: 12px;
    width: 90%;
    max-width: 400px;
}

.modal-actions {
    display: flex;
    gap: 1rem;
    margin-top: 1rem;
}

.modal-actions button {
    flex: 1;
}

#cancel-edit {
    background: #666;
}

.toast {
    position: fixed;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 1rem 2rem;
    border-radius: 8px;
    color: #fff;
    font-weight: bold;
    z-index: 2000;
    animation: slideUp 0.3s ease;
}

.toast.success {
    background: #4caf50;
}

.toast.error {
    background: #e94560;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
}

.empty-state {
    text-align: center;
    padding: 2rem;
    color: #666;
}

@media (max-width: 600px) {
    .container {
        padding: 0.75rem;
    }

    h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }

    h2 {
        font-size: 1.1rem;
    }

    .tabs {
        gap: 0.5rem;
    }

    .tab {
        padding: 0.6rem;
        font-size: 0.9rem;
    }

    .auth-form {
        padding: 1rem;
    }

    .header {
        flex-direction: column;
        gap: 0.75rem;
        text-align: center;
        padding: 0.75rem;
        margin-bottom: 1rem;
    }

    #logout-btn {
        width: 100%;
    }

    .add-password {
        padding: 1rem;
        margin-bottom: 1rem;
    }

    .form-row {
        flex-direction: column;
        gap: 0.5rem;
    }

    .form-row input {
        min-width: 100%;
    }

    .form-row button {
        width: 100%;
        padding: 0.75rem;
    }

    .passwords-list {
        padding: 0.75rem;
    }

    .password-item {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .password-info {
        text-align: center;
    }

    .password-site {
        font-size: 1rem;
    }

    .password-value {
        min-width: auto;
        text-align: center;
        padding: 0.5rem;
        font-size: 0.85rem;
        word-break: break-all;
    }

    .password-actions {
        display: flex;
        justify-content: center;
        gap: 0.5rem;
    }

    .btn-icon {
        width: 40px;
        height: 40px;
    }

    .btn-icon img {
        width: 20px;
        height: 20px;
    }

    .modal-content {
        padding: 1rem;
        width: 95%;
        max-height: 90vh;
        overflow-y: auto;
    }

    .modal-actions {
        flex-direction: column;
        gap: 0.5rem;
    }

    .toast {
        width: 90%;
        padding: 0.75rem 1rem;
        font-size: 0.9rem;
        bottom: 1rem;
    }

    input[type="text"],
    input[type="password"] {
        padding: 0.6rem;
        font-size: 16px; /* Empêche le zoom iOS */
    }

    button {
        font-size: 0.9rem;
    }
}
